mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
bnx2x: fix possible panic under memory stress
[ Upstream commit07b0f00964] While it is legal to kfree(NULL), it is not wise to use : put_page(virt_to_head_page(NULL)) BUG: unable to handle kernel paging request at ffffeba400000000 IP: [<ffffffffc01f5928>] virt_to_head_page+0x36/0x44 [bnx2x] Reported-by: Michel Lespinasse <walken@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Ariel Elior <ariel.elior@qlogic.com> Fixes:d46d132cc0("bnx2x: use netdev_alloc_frag()") Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4d8eb541f3
commit
eb7e73eafa
@@ -745,7 +745,8 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
|
||||
|
||||
return;
|
||||
}
|
||||
bnx2x_frag_free(fp, new_data);
|
||||
if (new_data)
|
||||
bnx2x_frag_free(fp, new_data);
|
||||
drop:
|
||||
/* drop the packet and keep the buffer in the bin */
|
||||
DP(NETIF_MSG_RX_STATUS,
|
||||
|
||||
Reference in New Issue
Block a user