From: Herbert Xu Date: Tue, 17 Mar 2009 20:11:29 +0000 (-0700) Subject: gro: Fix legacy path napi_complete crash X-Git-Tag: v3.0~10314^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=303c6a0251852ecbdc5c15e466dcaff5971f7517;p=platform%2Fkernel%2Flinux-amlogic.git gro: Fix legacy path napi_complete crash On the legacy netif_rx path, I incorrectly tried to optimise the napi_complete call by using __napi_complete before we reenable IRQs. This simply doesn't work since we need to flush the held GRO packets first. This patch fixes it by doing the obvious thing of reenabling IRQs first and then calling napi_complete. Reported-by: Frank Blaschka Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index f112970..2565f6d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2588,9 +2588,9 @@ static int process_backlog(struct napi_struct *napi, int quota) local_irq_disable(); skb = __skb_dequeue(&queue->input_pkt_queue); if (!skb) { - __napi_complete(napi); local_irq_enable(); - break; + napi_complete(napi); + goto out; } local_irq_enable(); @@ -2599,6 +2599,7 @@ static int process_backlog(struct napi_struct *napi, int quota) napi_gro_flush(napi); +out: return work; }