summaryrefslogtreecommitdiff
path: root/drivers/s390/net/lcs.c
diff options
context:
space:
mode:
authorAlexandra Winter <wintera@linux.ibm.com>2022-05-10 10:05:08 +0300
committerDavid S. Miller <davem@davemloft.net>2022-05-11 14:31:01 +0300
commit671bb35c8e746439f0ed70815968f9a4f20a8deb (patch)
tree359c4f74206330efac17d20523f50145d887e48e /drivers/s390/net/lcs.c
parent0c0b20587b9f25a2ad14db7f80ebe49bdf29920a (diff)
downloadlinux-671bb35c8e746439f0ed70815968f9a4f20a8deb.tar.xz
s390/lcs: fix variable dereferenced before check
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>
Diffstat (limited to 'drivers/s390/net/lcs.c')
-rw-r--r--drivers/s390/net/lcs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index bab9b34926c6..84c8981317b4 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1736,10 +1736,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");