diff options
author | Alexandra Winter <wintera@linux.ibm.com> | 2022-05-10 09:05:08 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-18 09:18:06 +0200 |
commit | c555d4827af4ecd093c9602e3af6ce8a8863638d (patch) | |
tree | 9104649c5c394c20c6070413c4da96a9521d30ba /drivers/s390/net/lcs.c | |
parent | d886b4292a1c5b4facdb2dfdc31f0fecc71df898 (diff) | |
download | linux-stable-c555d4827af4ecd093c9602e3af6ce8a8863638d.tar.gz linux-stable-c555d4827af4ecd093c9602e3af6ce8a8863638d.tar.bz2 linux-stable-c555d4827af4ecd093c9602e3af6ce8a8863638d.zip |
s390/lcs: fix variable dereferenced before check
[ Upstream commit 671bb35c8e746439f0ed70815968f9a4f20a8deb ]
smatch complains about
drivers/s390/net/lcs.c:1741 lcs_get_control() warn: variable dereferenced before check 'card->dev' (see line 1739)
Fixes: 27eb5ac8f015 ("[PATCH] s390: lcs driver bug fixes and improvements [1/2]")
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/s390/net/lcs.c')
-rw-r--r-- | drivers/s390/net/lcs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index d01b5c2a7760..da4d7284db67 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -1757,10 +1757,11 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd) lcs_schedule_recovery(card); break; case LCS_CMD_STOPLAN: - pr_warn("Stoplan for %s initiated by LGW\n", - card->dev->name); - if (card->dev) + if (card->dev) { + pr_warn("Stoplan for %s initiated by LGW\n", + card->dev->name); netif_carrier_off(card->dev); + } break; default: LCS_DBF_TEXT(5, trace, "noLGWcmd"); |