Merge branch 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus

* 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (22 commits)
  param: don't deref arg in __same_type() checks
  param: update drivers/acpi/debug.c to new scheme
  param: use module_param in drivers/message/fusion/mptbase.c
  ide: use module_param_named rather than module_param_call
  param: update drivers/char/ipmi/ipmi_watchdog.c to new scheme
  param: lock if_sdio's lbs_helper_name and lbs_fw_name against sysfs changes.
  param: lock myri10ge_fw_name against sysfs changes.
  param: simple locking for sysfs-writable charp parameters
  param: remove unnecessary writable charp
  param: add kerneldoc to moduleparam.h
  param: locking for kernel parameters
  param: make param sections const.
  param: use free hook for charp (fix leak of charp parameters)
  param: add a free hook to kernel_param_ops.
  param: silence .init.text references from param ops
  Add param ops struct for hvc_iucv driver.
  nfs: update for module_param_named API change
  AppArmor: update for module_param_named API change
  param: use ops in struct kernel_param, rather than get and set fns directly
  param: move the EXPORT_SYMBOL to after the definitions.
  ...
This commit is contained in:
Linus Torvalds
2010-08-12 10:01:59 -07:00
30 changed files with 658 additions and 253 deletions

View File

@@ -125,6 +125,8 @@ struct if_sdio_card {
const char *helper;
const char *firmware;
bool helper_allocated;
bool firmware_allocated;
u8 buffer[65536];
@@ -984,16 +986,34 @@ static int if_sdio_probe(struct sdio_func *func,
card->helper = if_sdio_models[i].helper;
card->firmware = if_sdio_models[i].firmware;
kparam_block_sysfs_write(helper_name);
if (lbs_helper_name) {
char *helper = kstrdup(lbs_helper_name, GFP_KERNEL);
if (!helper) {
kparam_unblock_sysfs_write(helper_name);
ret = -ENOMEM;
goto free;
}
lbs_deb_sdio("overriding helper firmware: %s\n",
lbs_helper_name);
card->helper = lbs_helper_name;
card->helper = helper;
card->helper_allocated = true;
}
kparam_unblock_sysfs_write(helper_name);
kparam_block_sysfs_write(fw_name);
if (lbs_fw_name) {
char *fw_name = kstrdup(lbs_fw_name, GFP_KERNEL);
if (!fw_name) {
kparam_unblock_sysfs_write(fw_name);
ret = -ENOMEM;
goto free;
}
lbs_deb_sdio("overriding firmware: %s\n", lbs_fw_name);
card->firmware = lbs_fw_name;
card->firmware = fw_name;
card->firmware_allocated = true;
}
kparam_unblock_sysfs_write(fw_name);
sdio_claim_host(func);
@@ -1127,6 +1147,10 @@ free:
kfree(packet);
}
if (card->helper_allocated)
kfree(card->helper);
if (card->firmware_allocated)
kfree(card->firmware);
kfree(card);
goto out;
@@ -1177,6 +1201,10 @@ static void if_sdio_remove(struct sdio_func *func)
kfree(packet);
}
if (card->helper_allocated)
kfree(card->helper);
if (card->firmware_allocated)
kfree(card->firmware);
kfree(card);
lbs_deb_leave(LBS_DEB_SDIO);

View File

@@ -289,10 +289,13 @@ static int if_usb_probe(struct usb_interface *intf,
}
/* Upload firmware */
kparam_block_sysfs_write(fw_name);
if (__if_usb_prog_firmware(cardp, lbs_fw_name, BOOT_CMD_FW_BY_USB)) {
kparam_unblock_sysfs_write(fw_name);
lbs_deb_usbd(&udev->dev, "FW upload failed\n");
goto err_prog_firmware;
}
kparam_unblock_sysfs_write(fw_name);
if (!(priv = lbs_add_card(cardp, &udev->dev)))
goto err_prog_firmware;

View File

@@ -811,12 +811,15 @@ static int if_usb_prog_firmware(struct if_usb_card *cardp)
lbtf_deb_enter(LBTF_DEB_USB);
kparam_block_sysfs_write(fw_name);
ret = request_firmware(&cardp->fw, lbtf_fw_name, &cardp->udev->dev);
if (ret < 0) {
pr_err("request_firmware() failed with %#x\n", ret);
pr_err("firmware %s not found\n", lbtf_fw_name);
kparam_unblock_sysfs_write(fw_name);
goto done;
}
kparam_unblock_sysfs_write(fw_name);
if (check_fwfile_format(cardp->fw->data, cardp->fw->size))
goto release_fw;