stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Larry Finger <Larry.Finger@lwfinger.net>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH 3.10 039/104] b43: Fix unload oops if firmware is not available
Date: Tue,  4 Feb 2014 13:01:42 -0800	[thread overview]
Message-ID: <20140204210223.837300221@linuxfoundation.org> (raw)
In-Reply-To: <20140204210222.731641778@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Larry Finger <Larry.Finger@lwfinger.net>

commit 0673effd41dba323d6a280ef37b5ef29f3f5a653 upstream.

The asyncronous firmware load uses a completion struct to hold firmware
processing until the user-space routines are up and running. There is.
however, a problem in that the waiter is nevered canceled during teardown.
As a result, unloading the driver when firmware is not available causes an oops.

To be able to access the completion structure at teardown, it had to be moved
into the b43_wldev structure.

This patch also fixes a typo in a comment.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/b43/b43.h  |    4 ++--
 drivers/net/wireless/b43/main.c |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -731,8 +731,6 @@ enum b43_firmware_file_type {
 struct b43_request_fw_context {
 	/* The device we are requesting the fw for. */
 	struct b43_wldev *dev;
-	/* a completion event structure needed if this call is asynchronous */
-	struct completion fw_load_complete;
 	/* a pointer to the firmware object */
 	const struct firmware *blob;
 	/* The type of firmware to request. */
@@ -809,6 +807,8 @@ enum {
 struct b43_wldev {
 	struct b43_bus_dev *dev;
 	struct b43_wl *wl;
+	/* a completion event structure needed if this call is asynchronous */
+	struct completion fw_load_complete;
 
 	/* The device initialization status.
 	 * Use b43_status() to query. */
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2068,6 +2068,7 @@ void b43_do_release_fw(struct b43_firmwa
 
 static void b43_release_firmware(struct b43_wldev *dev)
 {
+	complete(&dev->fw_load_complete);
 	b43_do_release_fw(&dev->fw.ucode);
 	b43_do_release_fw(&dev->fw.pcm);
 	b43_do_release_fw(&dev->fw.initvals);
@@ -2093,7 +2094,7 @@ static void b43_fw_cb(const struct firmw
 	struct b43_request_fw_context *ctx = context;
 
 	ctx->blob = firmware;
-	complete(&ctx->fw_load_complete);
+	complete(&ctx->dev->fw_load_complete);
 }
 
 int b43_do_request_fw(struct b43_request_fw_context *ctx,
@@ -2140,7 +2141,7 @@ int b43_do_request_fw(struct b43_request
 	}
 	if (async) {
 		/* do this part asynchronously */
-		init_completion(&ctx->fw_load_complete);
+		init_completion(&ctx->dev->fw_load_complete);
 		err = request_firmware_nowait(THIS_MODULE, 1, ctx->fwname,
 					      ctx->dev->dev->dev, GFP_KERNEL,
 					      ctx, b43_fw_cb);
@@ -2148,12 +2149,11 @@ int b43_do_request_fw(struct b43_request
 			pr_err("Unable to load firmware\n");
 			return err;
 		}
-		/* stall here until fw ready */
-		wait_for_completion(&ctx->fw_load_complete);
+		wait_for_completion(&ctx->dev->fw_load_complete);
 		if (ctx->blob)
 			goto fw_ready;
 	/* On some ARM systems, the async request will fail, but the next sync
-	 * request works. For this reason, we dall through here
+	 * request works. For this reason, we fall through here
 	 */
 	}
 	err = request_firmware(&ctx->blob, ctx->fwname,



  parent reply	other threads:[~2014-02-04 21:01 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 21:01 [PATCH 3.10 000/104] 3.10.29-stable review Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 002/104] md/raid5: fix long-standing problem with bitmap handling on write failure Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 003/104] drm/nouveau/bios: fix offset calculation for BMPv1 bioses Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 004/104] lib/decompressors: fix "no limit" output buffer length Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 005/104] mm: hugetlbfs: fix hugetlbfs optimization Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 006/104] e752x_edac: Fix pci_dev usage count Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 007/104] e1000e: fix compiler warnings Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 008/104] mm/mempolicy.c: fix mempolicy printing in numa_maps Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 009/104] x86, x32: Correct invalid use of user timespec in the kernel Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 010/104] x86/efi: Fix off-by-one bug in EFI Boot Services reservation Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 011/104] x86: Add check for number of available vectors before CPU down Greg Kroah-Hartman
2014-02-04 22:45   ` Prarit Bhargava
2014-02-04 21:01 ` [PATCH 3.10 012/104] KVM: x86: limit PIT timer frequency Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 014/104] usb: option: add new zte 3g modem pids to option driver Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 016/104] USB: cypress_m8: fix ring-indicator detection and reporting Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 017/104] USB: ftdi_sio: added CS5 quirk for broken smartcard readers Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 018/104] USB: Nokia 502 is an unusual device Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 019/104] usb: xhci: Check for XHCI_PLAT in xhci_cleanup_msix() Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 020/104] USB: fix race between hub_disconnect and recursively_mark_NOTATTACHED Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 021/104] usb: ehci: add freescale imx28 special write register method Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 022/104] rtlwifi: rtl8192cu: Add new device ID Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 023/104] rtlwifi: Update beacon statistics for USB driver Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 024/104] rtlwifi: rtl8192c: Prevent reconnect attempts if not connected Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 025/104] rtlwifi: rtl8192cu: Add new firmware Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 026/104] rtlwifi: Redo register save locations Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 027/104] rtlwifi: Set the link state Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 028/104] rtlwifi: rtl8192c: Add new definitions in the dm_common header Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 029/104] rtlwifi: Increase the RX queue length for USB drivers Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 030/104] rtlwifi: rtl8192c: Add routines to save/restore power index registers Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 031/104] rtlwifi: rtl8192cu: Update the " Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 032/104] rtlwifi: rtl8192cu: Fix some code in RF handling Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 033/104] rtlwifi: Add missing code to PWDB statics routine Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 034/104] rtlwifi: rtl8188ee: Fix typo in code Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 035/104] mwifiex: add missing endian conversion for fw_tsf Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 036/104] mwifiex: fix wrong 11ac bits setting in fw_cap_info Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 037/104] iwlwifi: mvm: fix missing cleanup in .start() error path Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 038/104] b43: Fix lockdep splat Greg Kroah-Hartman
2014-02-04 21:01 ` Greg Kroah-Hartman [this message]
2014-02-04 21:01 ` [PATCH 3.10 040/104] b43legacy: Fix unload oops if firmware is not available Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 041/104] b43: fix the wrong assignment of status.freq in b43_rx() Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 042/104] staging: r8712u: Set device type to wlan Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 043/104] staging: vt6656: [BUG] BBvUpdatePreEDThreshold Always set sensitivity on bScanning Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 044/104] staging: vt6656: CARDqGetNextTBTT correct uLowNextTBTT Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 045/104] tty/serial: at91: Handle shutdown more safely Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 046/104] ARM: at91: smc: bug fix in sam9_smc_cs_read() Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 047/104] hwmon: (k10temp) Add support for Kaveri CPUs Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 048/104] serial: add support for 200 v3 series Titan card Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 049/104] serial: 8250: Fix initialisation of Quatech cards with the AMCC PCI chip Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 050/104] serial: 8250: enable UART_BUG_NOMSR for Tegra Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 051/104] KVM: s390: fix diagnose code extraction Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 052/104] s390/uapi: fix struct statfs64 definition Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 053/104] parport: parport_pc: remove double PCI ID for NetMos Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 054/104] rtc-cmos: Add an alarm disable quirk Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 055/104] rtc: max8907: weekday encoding fixes Greg Kroah-Hartman
2014-02-04 21:01 ` [PATCH 3.10 056/104] pinctrl: sunxi: Honor GPIO output initial vaules Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 057/104] perf kvm: Fix kvm report without guestmount Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 058/104] mfd: max77686: Fix regmap resource leak on driver remove Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 059/104] ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 060/104] ASoC: wm5110: Extend SYSCLK patch file for rev D Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 061/104] ALSA: rme9652: fix a missing comma in channel_map_9636_ds[] Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 062/104] ALSA: hda - Dont create duplicated ctls for loopback paths Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 063/104] ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 065/104] tpm/tpm_i2c_stm_st33: Check return code of get_burstcount Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 066/104] tpm/tpm_ppi: Do not compare strcmp(a,b) == -1 Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 067/104] ata: sata_mv: introduce compatible string "marvell, armada-370-sata" Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 068/104] ata: sata_mv: fix disk hotplug for Armada 370/XP SoCs Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 069/104] libata: disable LPM for some WD SATA-I devices Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 070/104] ext4: avoid clearing beyond i_blocks when truncating an inline data file Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 071/104] vfs: Is mounted should be testing mnt_ns for NULL or error Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 072/104] bcache: Data corruption fix Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 074/104] bnx2x: fix DMA unmapping of TSO split BDs Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 075/104] inet_diag: fix inet_diag_dump_icsk() timewait socket state logic Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 076/104] ieee802154: Fix memory leak in ieee802154_add_iface() Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 077/104] net: avoid reference counter overflows on fib_rules in multicast forwarding Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 078/104] net,via-rhine: Fix tx_timeout handling Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 079/104] net: rds: fix per-cpu helper usage Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 080/104] tcp: metrics: Avoid duplicate entries with the same destination-IP Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 081/104] bpf: do not use reciprocal divide Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 082/104] s390/bpf,jit: fix 32 bit divisions, use unsigned divide instructions Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 083/104] ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 084/104] fib_frontend: fix possible NULL pointer dereference Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 085/104] net: Fix memory leak if TPROXY used with TCP early demux Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 086/104] xen-netfront: fix resource leak in netfront Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 087/104] sit: fix double free of fb_tunnel_dev on exit Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 088/104] Revert "ip6tnl: fix use after free of fb_tnl_dev" Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 089/104] ip6tnl: fix double free of fb_tnl_dev on exit Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 090/104] iwlwifi: pcie: enable oscillator for L1 exit Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 091/104] parisc: fix cache-flushing Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 092/104] KVM: PPC: Book3S HV: use xics_wake_cpu only when defined Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 093/104] KVM: PPC: e500: Fix bad address type in deliver_tlb_misss() Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 094/104] ALSA: hda - hdmi: introduce patch_nvhdmi() Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 095/104] ALSA: hda/hdmi - allow PIN_OUT to be dynamically enabled Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 096/104] iwlwifi: pcie: fix interrupt coalescing for 7260 / 3160 Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 097/104] usb: core: get config and string descriptors for unauthorized devices Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 098/104] SCSI: bfa: Chinook quad port 16G FC HBA claim issue Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 099/104] virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 100/104] target/iscsi: Fix network portal creation race Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 101/104] Btrfs: handle EAGAIN case properly in btrfs_drop_snapshot() Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 102/104] btrfs: restrict snapshotting to own subvolumes Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 103/104] powerpc: Fix the setup of CPU-to-Node mappings during CPU online Greg Kroah-Hartman
2014-02-04 21:02 ` [PATCH 3.10 104/104] powerpc: Make sure "cache" directory is removed when offlining cpu Greg Kroah-Hartman
2014-02-05  6:38 ` [PATCH 3.10 000/104] 3.10.29-stable review Guenter Roeck
2014-02-05 20:40 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140204210223.837300221@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).