aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas_tf
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-08-12 01:04:27 -0400
committerRusty Russell <rusty@rustcorp.com.au>2010-08-11 09:34:31 -0400
commitd6d1b650ae6acce73d55dd0246de22180303ae73 (patch)
tree7a342999c119a5ee6395966cee91ddf5186f5665 /drivers/net/wireless/libertas_tf
parentdca41306395eab37e222ff9e72765e692fcc7251 (diff)
param: simple locking for sysfs-writable charp parameters
Since the writing to sysfs can free the old one, we need to block that when we access the charp variables. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Takashi Iwai <tiwai@suse.de> Tested-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Cc: Jeff Dike <jdike@addtoit.com> Cc: Dan Williams <dcbw@redhat.com> Cc: John W. Linville <linville@tuxdriver.com> Cc: Jing Huang <huangj@brocade.com> Cc: James E.J. Bottomley <James.Bottomley@suse.de> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: David S. Miller <davem@davemloft.net> Cc: user-mode-linux-devel@lists.sourceforge.net Cc: libertas-dev@lists.infradead.org Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-scsi@vger.kernel.org Cc: linux-usb@vger.kernel.org
Diffstat (limited to 'drivers/net/wireless/libertas_tf')
-rw-r--r--drivers/net/wireless/libertas_tf/if_usb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c
index b172f5d87a3b..41a4f214ade1 100644
--- a/drivers/net/wireless/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/libertas_tf/if_usb.c
@@ -811,12 +811,15 @@ static int if_usb_prog_firmware(struct if_usb_card *cardp)
811 811
812 lbtf_deb_enter(LBTF_DEB_USB); 812 lbtf_deb_enter(LBTF_DEB_USB);
813 813
814 kparam_block_sysfs_write(fw_name);
814 ret = request_firmware(&cardp->fw, lbtf_fw_name, &cardp->udev->dev); 815 ret = request_firmware(&cardp->fw, lbtf_fw_name, &cardp->udev->dev);
815 if (ret < 0) { 816 if (ret < 0) {
816 pr_err("request_firmware() failed with %#x\n", ret); 817 pr_err("request_firmware() failed with %#x\n", ret);
817 pr_err("firmware %s not found\n", lbtf_fw_name); 818 pr_err("firmware %s not found\n", lbtf_fw_name);
819 kparam_unblock_sysfs_write(fw_name);
818 goto done; 820 goto done;
819 } 821 }
822 kparam_unblock_sysfs_write(fw_name);
820 823
821 if (check_fwfile_format(cardp->fw->data, cardp->fw->size)) 824 if (check_fwfile_format(cardp->fw->data, cardp->fw->size))
822 goto release_fw; 825 goto release_fw;