Skip to content

Commit

Permalink
s390/lcs: fix variable dereferenced before check
Browse files Browse the repository at this point in the history
[ Upstream commit 671bb35 ]

smatch complains about
drivers/s390/net/lcs.c:1741 lcs_get_control() warn: variable dereferenced before check 'card->dev' (see line 1739)

Fixes: 27eb5ac ("[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>
  • Loading branch information
SandyWinter authored and gregkh committed May 18, 2022
1 parent 4d3c6d7 commit b816ed5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/s390/net/lcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1735,10 +1735,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");
Expand Down

0 comments on commit b816ed5

Please sign in to comment.