Bugzilla – Bug 597
Missing kmalloc return value check causes oops when suspending.
Last modified: 2005-10-06 16:46:48
You need to log in before you can comment on or make changes to this bug.
I got a kernel panic recently when trying to suspend my machine (with software suspend 2) that was caused by ipw2200 (version 0.22), and repeated again on 1.0.1. The oops is at http://dagobah.ucc.asn.au/ipw2200-oops/dscf1521.jpg And some prior dmesg at http://dagobah.ucc.asn.au/ipw2200-oops/dscf1522.jpg The interesting bits from the dmesg read something like: Software Suspend 2.1.7: Initiating a software suspend cycle. ipw2200: Firmware error detected. Restarting. ipw2200: Firmware error detected. Restarting. wlan0: Can not allocate SKB buffers. <- wlan0 is the ipw2200 ipw2200: Unable to load boot firmware. *an Oops involving kfree in ipw_rx_queue_free* This was tracked down to a missing kmalloc return value check in ipw_rx_queue_alloc(). Patch to follow.
Created an attachment (id=275) [details] Check return value of kmalloc This appears to fix the bug for me. It was an intermittent bug, and I haven't had an oops on suspending yet with this patch.
Patch is valid, but I can hardly see how it fixed this problem.
You're right that it really doesn't seem related. I guess the bug is just sufficiently intermittent enough to be deceptive. I got the oops at least a couple of times in a week without the patch, and haven't had it once yet with the patch - seems it's just luck. More likely a candidate - does ipw_rx_queue_reset need to set the skb pointer to NULL after calling dev_kfree_skb?
Created an attachment (id=280) [details] NULL out skb after being freed This patch NULLs out the skb after it is freed to keep it from being freed again if ipw_rx_queue_reset is called before replenish reallocates the skbs.
Please try the NULL out patch and see if it corrects the oops behavior.
A day of usage with about 20 or 30 suspends, and I haven't hit the bug. It might just be luck, as I haven't noticed the same sequence of error messages that led up to the original oops. But I do think this has patch nailed it.
The bug is possibly fixed by this patch, and the patch is in ipw2200 1.0.2. Please use the latest version of the driver. Mark the bug as fixed and verified, since submitter didn't get the problem after applying the patch. If it happens again with 1.0.2, please reopen it.