From caa0a99acd2c4eb0a8d4e9caae397291e4cf743a Mon Sep 17 00:00:00 2001 From: Sujith Manoharan Date: Tue, 7 Dec 2010 16:32:02 +0530 Subject: [PATCH] ath9k_htc: Fix panic on FW download failure Use the correct error condition exit in case firmware download fails for some reason. Not doing so results in a panic: usb 1-3: ath9k_htc: Transferred FW: ar9271.fw, size: 51280 usb 1-3: ath9k_htc: Firmware - ar9271.fw download failed usb 1-3: ath9k_htc: Target is unresponsive Failed to initialize the device INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. Pid: 2823, comm: insmod Tainted: G W 2.6.37-rc4-wl #11 Call Trace: [] __lock_acquire+0xe3e/0x1d00 [] ? restore_args+0x0/0x30 [] ? vprintk+0x321/0x500 [] lock_acquire+0xa0/0x190 [] ? usb_kill_anchored_urbs+0x1c/0x80 [usbcore] [] _raw_spin_lock_irq+0x48/0x60 [] ? usb_kill_anchored_urbs+0x1c/0x80 [usbcore] [] ? printk+0x3c/0x3f [] usb_kill_anchored_urbs+0x1c/0x80 [usbcore] [] ath9k_hif_usb_dealloc_urbs+0x18/0x40 [ath9k_htc] [] ath9k_hif_usb_probe+0x227/0x3d0 [ath9k_htc] [] usb_probe_interface+0x10c/0x210 [usbcore] [] driver_probe_device+0x96/0x1c0 [] __driver_attach+0xa3/0xb0 [] ? __driver_attach+0x0/0xb0 [] bus_for_each_dev+0x5e/0x90 [] driver_attach+0x19/0x20 [] bus_add_driver+0x168/0x320 [] driver_register+0x71/0x140 [] ? __raw_spin_lock_init+0x38/0x70 [] usb_register_driver+0xdc/0x190 [usbcore] [] ? ath9k_htc_init+0x0/0x4f [ath9k_htc] [] ath9k_hif_usb_init+0x1e/0x20 [ath9k_htc] [] ath9k_htc_init+0x2b/0x4f [ath9k_htc] [] do_one_initcall+0x3f/0x180 [] sys_init_module+0xbb/0x200 [] system_call_fastpath+0x16/0x1b Signed-off-by: Sujith Manoharan Signed-off-by: John W. Linville --- drivers/net/wireless/ath/ath9k/hif_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index cc1e5b3444a4..45d4b2403a52 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -885,9 +885,9 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev, u32 drv_info) return 0; -err_fw_download: - ath9k_hif_usb_dealloc_urbs(hif_dev); err_urb: + ath9k_hif_usb_dealloc_urbs(hif_dev); +err_fw_download: release_firmware(hif_dev->firmware); err_fw_req: hif_dev->firmware = NULL; -- 2.30.2