net: dsa: b53: remove redundant null check on dev
authorColin Ian King <colin.king@canonical.com>
Tue, 15 Jun 2021 09:05:16 +0000 (10:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Jun 2021 18:28:01 +0000 (11:28 -0700)
The pointer dev can never be null, the null check is redundant
and can be removed. Cleans up a static analysis warning that
pointer priv is dereferencing dev before dev is being null
checked.

Addresses-Coverity: ("Dereference before null check")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_srab.c

index aaa12d7..3f4249d 100644 (file)
@@ -632,8 +632,7 @@ static int b53_srab_remove(struct platform_device *pdev)
        struct b53_srab_priv *priv = dev->priv;
 
        b53_srab_intr_set(priv, false);
-       if (dev)
-               b53_switch_remove(dev);
+       b53_switch_remove(dev);
 
        return 0;
 }