]> git.itanic.dy.fi Git - linux-stable/commit
bnx2x: fix possible panic under memory stress
authorEric Dumazet <edumazet@google.com>
Thu, 26 Jun 2014 07:44:02 +0000 (00:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Jul 2014 15:00:04 +0000 (08:00 -0700)
commiteb7e73eafa8fc5168bc734431f831c9f6aef134a
tree44ff788df46e392cd9f2003e051cfab4c2b1833b
parent4d8eb541f3bed4daf65dc188e7aa0824b1ac0d75
bnx2x: fix possible panic under memory stress

[ Upstream commit 07b0f00964def8af9321cfd6c4a7e84f6362f728 ]

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: d46d132cc021 ("bnx2x: use netdev_alloc_frag()")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c