]> git.baikalelectronics.ru Git - kernel.git/commit
net/cpsw: don't continue if we miss to allocate rx skbs
authorSebastian Siewior <bigeasy@linutronix.de>
Tue, 23 Apr 2013 07:31:36 +0000 (07:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Apr 2013 08:11:49 +0000 (04:11 -0400)
commit0010cb8eb230fa16c26bf2f05b587293baec86bb
treef9b54c50ec8822b253feefd1b41ded0e20e681d7
parentf591c2e123ceb0a266d9f70ea397afacd8fa38a3
net/cpsw: don't continue if we miss to allocate rx skbs

if during "ifconfig up" we run out of mem we continue regardless how
many skbs we got. In worst case we have zero RX skbs and can't ever
receive further packets since the RX skbs are never reallocated. If
cpdma_chan_submit() fails we even leak the skb.
This patch changes the behavior here:
If we fail to allocate an skb during bring up we don't continue and
report that error. Same goes for errors from cpdma_chan_submit().
While here I changed to __netdev_alloc_skb_ip_align() so GFP_KERNEL can
be used.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c