linux/drivers/s390/net
Arnd Bergmann 27b141fc23 s390: ctcm: fix ctcm_new_device error return code
clang points out that the return code from this function is
undefined for one of the error paths:

../drivers/s390/net/ctcm_main.c:1595:7: warning: variable 'result' is used uninitialized whenever 'if' condition is true
      [-Wsometimes-uninitialized]
                if (priv->channel[direction] == NULL) {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/s390/net/ctcm_main.c:1638:9: note: uninitialized use occurs here
        return result;
               ^~~~~~
../drivers/s390/net/ctcm_main.c:1595:3: note: remove the 'if' if its condition is always false
                if (priv->channel[direction] == NULL) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/s390/net/ctcm_main.c:1539:12: note: initialize the variable 'result' to silence this warning
        int result;
                  ^

Make it return -ENODEV here, as in the related failure cases.
gcc has a known bug in underreporting some of these warnings
when it has already eliminated the assignment of the return code
based on some earlier optimization step.

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17 23:25:35 -07:00
..
ctcm_dbug.c
ctcm_dbug.h
ctcm_fsms.c
ctcm_fsms.h
ctcm_main.c s390: ctcm: fix ctcm_new_device error return code 2019-04-17 23:25:35 -07:00
ctcm_main.h
ctcm_mpc.c
ctcm_mpc.h
ctcm_sysfs.c
fsm.c
fsm.h
ism_drv.c s390/ism: ignore some errors during deregistration 2019-02-20 09:48:32 +01:00
ism.h s390/ism: add device driver for internal shared memory 2018-06-30 20:42:26 +09:00
Kconfig s390/ism: add device driver for internal shared memory 2018-06-30 20:42:26 +09:00
lcs.c s390/net: set HW port number in netdevice 2018-04-27 13:38:47 -04:00
lcs.h
Makefile s390/qeth: move ethtool code into its own file 2019-02-15 20:35:29 -08:00
netiucv.c
qeth_core_main.c s390/qeth: be drop monitor friendly 2019-03-18 18:34:45 -07:00
qeth_core_mpc.c s390/qeth: allow cmd callbacks to return errnos 2019-02-12 13:14:24 -05:00
qeth_core_mpc.h s390/qeth: split out OSN netdev ops 2019-02-15 20:35:30 -08:00
qeth_core_sys.c s390/qeth: drop redundant state checking 2019-02-28 12:55:26 -08:00
qeth_core.h s390/qeth: drop redundant state checking 2019-02-28 12:55:26 -08:00
qeth_ethtool.c s390/qeth: add support for ETHTOOL_GRINGPARAM 2019-02-15 20:35:30 -08:00
qeth_l2_main.c s390/qeth: be drop monitor friendly 2019-03-18 18:34:45 -07:00
qeth_l2_sys.c
qeth_l2.h s390/qeth: clean up exported symbols 2018-07-12 16:42:39 -07:00
qeth_l3_main.c s390/qeth: be drop monitor friendly 2019-03-18 18:34:45 -07:00
qeth_l3_sys.c s390/qeth: remove RECOVER state 2019-02-28 12:55:25 -08:00
qeth_l3.h
smsgiucv_app.c
smsgiucv.c
smsgiucv.h