Enable -Wmaybe-uninitialised; Fixed uninitialized kfree().

This commit is contained in:
Florian Pose 2024-06-06 14:24:56 +02:00
parent d22a450aae
commit 220bb4661a
2 changed files with 3 additions and 4 deletions

View File

@ -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. # 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) CFLAGS_module.o := -DREV=$(REV)
KBUILD_CFLAGS += -Wmaybe-uninitialized
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

View File

@ -3386,7 +3386,6 @@ static ATTRIBUTES int ec_ioctl_sc_ip(
{ {
ec_ioctl_eoe_ip_t io; ec_ioctl_eoe_ip_t io;
ec_slave_config_t *sc; ec_slave_config_t *sc;
uint8_t *key;
if (unlikely(!ctx->requested)) { if (unlikely(!ctx->requested)) {
return -EPERM; return -EPERM;
@ -3397,13 +3396,11 @@ static ATTRIBUTES int ec_ioctl_sc_ip(
} }
if (down_interruptible(&master->master_sem)) { if (down_interruptible(&master->master_sem)) {
kfree(key);
return -EINTR; return -EINTR;
} }
if (!(sc = ec_master_get_config(master, io.config_index))) { if (!(sc = ec_master_get_config(master, io.config_index))) {
up(&master->master_sem); up(&master->master_sem);
kfree(key);
return -ENOENT; return -ENOENT;
} }