]> 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)
commit6fff5b9ab3bdb3d37fffbd30673e305453e8a5cb
treef9b54c50ec8822b253feefd1b41ded0e20e681d7
parent1a5fedf285f988c0a34581285b36bd593ec393a2
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