From 220bb4661aa99e67d4bc1d77001a5d2025cc0e10 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Thu, 6 Jun 2024 14:24:56 +0200 Subject: [PATCH] Enable -Wmaybe-uninitialised; Fixed uninitialized kfree(). --- master/Kbuild.in | 4 +++- master/ioctl.c | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/master/Kbuild.in b/master/Kbuild.in index 642ea1ff..afba2202 100644 --- a/master/Kbuild.in +++ b/master/Kbuild.in @@ -1,6 +1,6 @@ #----------------------------------------------------------------------------- # -# Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH +# Copyright (C) 2006-2024 Florian Pose, Ingenieurgemeinschaft IgH # # This file is part of the IgH EtherCAT Master. # @@ -107,4 +107,6 @@ REV := $(shell if test -s $(src)/../revision; then \ CFLAGS_module.o := -DREV=$(REV) +KBUILD_CFLAGS += -Wmaybe-uninitialized + #----------------------------------------------------------------------------- diff --git a/master/ioctl.c b/master/ioctl.c index ceceb83d..84c4bd67 100644 --- a/master/ioctl.c +++ b/master/ioctl.c @@ -3386,7 +3386,6 @@ static ATTRIBUTES int ec_ioctl_sc_ip( { ec_ioctl_eoe_ip_t io; ec_slave_config_t *sc; - uint8_t *key; if (unlikely(!ctx->requested)) { return -EPERM; @@ -3397,13 +3396,11 @@ static ATTRIBUTES int ec_ioctl_sc_ip( } if (down_interruptible(&master->master_sem)) { - kfree(key); return -EINTR; } if (!(sc = ec_master_get_config(master, io.config_index))) { up(&master->master_sem); - kfree(key); return -ENOENT; }