netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dp83640: don't recieve time stamps twice
@ 2017-04-18 19:14 Dan Carpenter
  2017-04-18 20:19 ` Richard Cochran
  2017-04-19  9:16 ` Sørensen, Stefan
  0 siblings, 2 replies; 9+ messages in thread
From: Dan Carpenter @ 2017-04-18 19:14 UTC (permalink / raw)
  To: Richard Cochran, Stefan Sørensen
  Cc: Andrew Lunn, Florian Fainelli, netdev, kernel-janitors

This patch is prompted by a static checker warning about a potential
use after free.  The concern is that netif_rx_ni() can free "skb" and we
call it twice.

When I look at the commit that added this, it looks like some stray
lines were added accidentally.  It doesn't make sense to me that we
would recieve the same data two times.  I asked the author but never
recieved a response.

I can't test this code, but I'm pretty sure my patch is correct.

Fixes: 4b063258ab93 ("dp83640: Delay scheduled work.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index e2460a57e4b1..ed0d10f54f26 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -1438,8 +1438,6 @@ static bool dp83640_rxtstamp(struct phy_device *phydev,
 		skb_info->tmo = jiffies + SKB_TIMESTAMP_TIMEOUT;
 		skb_queue_tail(&dp83640->rx_queue, skb);
 		schedule_delayed_work(&dp83640->ts_work, SKB_TIMESTAMP_TIMEOUT);
-	} else {
-		netif_rx_ni(skb);
 	}
 
 	return true;

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-04-20 21:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-18 19:14 [PATCH] dp83640: don't recieve time stamps twice Dan Carpenter
2017-04-18 20:19 ` Richard Cochran
2017-04-19  9:16 ` Sørensen, Stefan
2017-04-19 10:31   ` Richard Cochran
2017-04-19 10:53     ` Dan Carpenter
2017-04-19 11:28     ` Sørensen, Stefan
2017-04-19 11:54       ` Richard Cochran
2017-04-20 20:02     ` David Miller
2017-04-20 21:30       ` Richard Cochran

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).