[PATCH net] net: nb8800: Fix SKB leak in nb8800_receive()
In case nb8800_receive() fails to allocate a fragment, we would leak the SKB freshly allocated and just return, instead, free it. Reported-by: coverity (CID 1341750) Signed-off-by: Florian Fainelli --- drivers/net/ethernet/aurora/nb8800.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index 08a23e6b60e9..1a3555d03a96 100644 --- a/drivers/net/ethernet/aurora/nb8800.c +++ b/drivers/net/ethernet/aurora/nb8800.c @@ -259,6 +259,7 @@ static void nb8800_receive(struct net_device *dev, unsigned int i, if (err) { netdev_err(dev, "rx buffer allocation failed\n"); dev->stats.rx_dropped++; + dev_kfree_skb(skb); return; } -- 2.7.4
Re: [PATCH net] net: nb8800: Fix SKB leak in nb8800_receive()
Florian Fainelli writes: > In case nb8800_receive() fails to allocate a fragment, we would leak the > SKB freshly allocated and just return, instead, free it. > > Reported-by: coverity (CID 1341750) > Signed-off-by: Florian Fainelli Acked-by: Mans Rullgard > --- > drivers/net/ethernet/aurora/nb8800.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/aurora/nb8800.c > b/drivers/net/ethernet/aurora/nb8800.c > index 08a23e6b60e9..1a3555d03a96 100644 > --- a/drivers/net/ethernet/aurora/nb8800.c > +++ b/drivers/net/ethernet/aurora/nb8800.c > @@ -259,6 +259,7 @@ static void nb8800_receive(struct net_device *dev, > unsigned int i, > if (err) { > netdev_err(dev, "rx buffer allocation failed\n"); > dev->stats.rx_dropped++; > + dev_kfree_skb(skb); > return; > } > > -- > 2.7.4 > -- Måns Rullgård
Re: [PATCH net] net: nb8800: Fix SKB leak in nb8800_receive()
From: Florian Fainelli Date: Fri, 15 Jul 2016 16:41:16 -0700 > In case nb8800_receive() fails to allocate a fragment, we would leak the > SKB freshly allocated and just return, instead, free it. > > Reported-by: coverity (CID 1341750) > Signed-off-by: Florian Fainelli Applied.