]> git.baikalelectronics.ru Git - kernel.git/commit
rtlwifi: Fix kernel panic resulting from RX buffer allocation failure
authorLarry Finger <Larry.Finger@lwfinger.net>
Thu, 19 May 2011 15:17:04 +0000 (10:17 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 26 May 2011 19:43:29 +0000 (15:43 -0400)
commitbd7647cac8a66e136dae7ae137303093793bec35
treed56f68c680cec8c376017c66bbe5851f25218252
parent348052b8d3477d22e25227e367351bf71434b6fb
rtlwifi: Fix kernel panic resulting from RX buffer allocation failure

To handle amsdu_8k capability, the PCI routine of this driver must
allocate receive buffers of order 2. Under heavy load, this causes
fragmentation of memory. The present code releases the current buffer
before checking to see if a new one is availble. Recovery from
allocation failures is not possible, which results in kernel panics.

The fix is to reorder the code to check that a new buffer can be
allocated before the old one is released. If not possible, the
received frame is dropped and the old one is reused. Without this
change, it is impossible to transfer a 2 GB file without a kernel panic.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [2.6.{37,38,39}]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/pci.c