diff --git a/patches.suse/s390-ctcm-fix-ctcm_new_device-error-return-code.patch b/patches.suse/s390-ctcm-fix-ctcm_new_device-error-return-code.patch new file mode 100644 index 0000000..db30e9c --- /dev/null +++ b/patches.suse/s390-ctcm-fix-ctcm_new_device-error-return-code.patch @@ -0,0 +1,51 @@ +From: Arnd Bergmann +Date: Wed, 17 Apr 2019 18:29:13 +0200 +Subject: s390: ctcm: fix ctcm_new_device error return code +Git-commit: 27b141fc234a3670d21bd742c35d7205d03cbb3a +Patch-mainline: v5.1-rc7 +References: git-fixes bsc#1211361 + +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 +Signed-off-by: Arnd Bergmann +Signed-off-by: Julian Wiedmann +Signed-off-by: David S. Miller +Acked-by: Miroslav Franc +--- + drivers/s390/net/ctcm_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c +index 7617d21cb296..f63c5c871d3d 100644 +--- a/drivers/s390/net/ctcm_main.c ++++ b/drivers/s390/net/ctcm_main.c +@@ -1595,6 +1595,7 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev) + if (priv->channel[direction] == NULL) { + if (direction == CTCM_WRITE) + channel_free(priv->channel[CTCM_READ]); ++ result = -ENODEV; + goto out_dev; + } + priv->channel[direction]->netdev = dev; + diff --git a/series.conf b/series.conf index f4cd89b..c063830 100644 --- a/series.conf +++ b/series.conf @@ -48941,6 +48941,7 @@ patches.suse/sunrpc-don-t-mark-uninitialised-items-as-VALID.patch patches.suse/nfsd-Don-t-release-the-callback-slot-unless-it-was-a.patch patches.suse/ipv4-set-the-tcp_min_rtt_wlen-range-from-0-to-one-da.patch + patches.suse/s390-ctcm-fix-ctcm_new_device-error-return-code.patch patches.suse/mlxsw-spectrum-Put-MC-TCs-into-DWRR-mode.patch patches.suse/mlxsw-pci-Reincrease-PCI-reset-timeout.patch patches.suse/mlxsw-spectrum-Fix-autoneg-status-in-ethtool.patch