can: dev: can_restart(): remove unused code
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Sat, 21 Oct 2017 03:36:52 +0000 (22:36 -0500)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 11 Nov 2019 20:57:28 +0000 (21:57 +0100)
Value assigned to variable err is overwritten at line
562: err = priv->do_set_mode(dev, CAN_MODE_START); before
it can be used.

Also, notice that this code has been there since 2014.

Addresses-Coverity-ID: 1227031
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev.c

index 1c88c361938cceb5effdfb8b593f1000be2fc800..6ee06a49fb4cdc4d8ffcb029918590539d192ee0 100644 (file)
@@ -553,10 +553,9 @@ static void can_restart(struct net_device *dev)
 
        /* send restart message upstream */
        skb = alloc_can_err_skb(dev, &cf);
-       if (!skb) {
-               err = -ENOMEM;
+       if (!skb)
                goto restart;
-       }
+
        cf->can_id |= CAN_ERR_RESTARTED;
 
        netif_rx(skb);