ee3a71ffa5a44ee128779ccfce73def74e62d41e
[openwrt/openwrt.git] /
1 From 11b57faf951cd3a570e3d9e463fc7c41023bc8c6 Mon Sep 17 00:00:00 2001
2 From: Colin Ian King <colin.king@canonical.com>
3 Date: Tue, 15 Jun 2021 10:05:16 +0100
4 Subject: [PATCH] net: dsa: b53: remove redundant null check on dev
5
6 The pointer dev can never be null, the null check is redundant
7 and can be removed. Cleans up a static analysis warning that
8 pointer priv is dereferencing dev before dev is being null
9 checked.
10
11 Addresses-Coverity: ("Dereference before null check")
12 Signed-off-by: Colin Ian King <colin.king@canonical.com>
13 Acked-by: Florian Fainelli <f.fainelli@gmail.com>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 ---
16 drivers/net/dsa/b53/b53_srab.c | 3 +--
17 1 file changed, 1 insertion(+), 2 deletions(-)
18
19 --- a/drivers/net/dsa/b53/b53_srab.c
20 +++ b/drivers/net/dsa/b53/b53_srab.c
21 @@ -632,8 +632,7 @@ static int b53_srab_remove(struct platfo
22 struct b53_srab_priv *priv = dev->priv;
23
24 b53_srab_intr_set(priv, false);
25 - if (dev)
26 - b53_switch_remove(dev);
27 + b53_switch_remove(dev);
28
29 return 0;
30 }