* [PATCH net-next] sunvnet: fix potential NULL pointer dereference
@ 2014-10-01 15:05 David L Stevens
2014-10-01 19:26 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: David L Stevens @ 2014-10-01 15:05 UTC (permalink / raw)
To: David Miller; +Cc: netdev
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>
---
drivers/net/ethernet/sun/sunvnet.c | 2 +-
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;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] sunvnet: fix potential NULL pointer dereference
2014-10-01 15:05 [PATCH net-next] sunvnet: fix potential NULL pointer dereference David L Stevens
@ 2014-10-01 19:26 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-10-01 19:26 UTC (permalink / raw)
To: david.stevens; +Cc: netdev
From: David L Stevens <david.stevens@oracle.com>
Date: Wed, 01 Oct 2014 11:05:27 -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>
Applied, thanks David.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-01 19:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-01 15:05 [PATCH net-next] sunvnet: fix potential NULL pointer dereference David L Stevens
2014-10-01 19:26 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).