summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid L Stevens <david.stevens@oracle.com>2014-10-01 11:05:27 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-01 15:26:09 -0400
commita29c9c43bb633a9965909cd548879fee4aa789a4 (patch)
tree995c7a2198797ba0fad06886d08e8133f9f934c7
parente506d405ac7d34d03996c97ac68aa2ac010be64a (diff)
downloadop-kernel-dev-a29c9c43bb633a9965909cd548879fee4aa789a4.zip
op-kernel-dev-a29c9c43bb633a9965909cd548879fee4aa789a4.tar.gz
sunvnet: fix potential NULL pointer dereference
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>
-rw-r--r--drivers/net/ethernet/sun/sunvnet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index 1262697..1539672 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -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;
OpenPOWER on IntegriCloud