]> git.baikalelectronics.ru Git - kernel.git/commit
net: moxa: continue loop on skb allocation failure
authorJonas Jensen <jonas.jensen@gmail.com>
Mon, 25 Aug 2014 14:22:40 +0000 (16:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Aug 2014 00:25:39 +0000 (17:25 -0700)
commit3d867852f8f61dfe3bbb59a2b4c5eab7c1ce4eb9
tree329a381b4a657a7964f5b58b0d909ad50537c304
parent34bb7e84c0b7a2119c2fb196c458576885d79870
net: moxa: continue loop on skb allocation failure

If netdev_alloc_skb_ip_align() fails, subsequent code will
try to dereference an invalid pointer.

Continue to next descriptor on error.

While we're at it,

1. eliminate the chance of an endless loop, replace the main
   loop with while(rx < budget)

2. use napi_complete() and remove the explicit napi_gro_flush()

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/moxa/moxart_ether.c