sunvnet: fix potential NULL pointer dereference
authorDavid L Stevens <david.stevens@oracle.com>
Wed, 1 Oct 2014 15:05:27 +0000 (11:05 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Oct 2014 19:26:09 +0000 (15:26 -0400)
One of the error cases for vnet_start_xmit()'s "out_dropped" label
is port == NULL, so only mess with port->clean_timer when port is not NULL.

Signed-off-by: David L Stevens <david.stevens@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/sunvnet.c

index 126269762ee71b915212477596f2706eec70599c..15396720f489a802338eda997b26dbff2de66103 100644 (file)
@@ -1073,7 +1073,7 @@ out_dropped:
        if (pending)
                (void)mod_timer(&port->clean_timer,
                                jiffies + VNET_CLEAN_TIMEOUT);
-       else
+       else if (port)
                del_timer(&port->clean_timer);
        dev->stats.tx_dropped++;
        return NETDEV_TX_OK;