Commit d6c8aa39 authored by Ming Lei's avatar Ming Lei Committed by Greg Kroah-Hartman
Browse files

firmware loader: simplify holding module for request_firmware

module reference doesn't cover direct loading path, so this patch
simply holds the module in the whole life time of request_firmware()
to fix the problem.

Signed-off-by: default avatarMing Lei <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 93232e46
......@@ -523,8 +523,6 @@ static void fw_dev_release(struct device *dev)
struct firmware_priv *fw_priv = to_firmware_priv(dev);
static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
......@@ -852,9 +850,6 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, bool uevent,
dev_set_uevent_suppress(f_dev, true);
/* Need to pin this module until class device is destroyed */
retval = device_add(f_dev);
if (retval) {
dev_err(f_dev, "%s: device_register failed\n", __func__);
......@@ -1131,7 +1126,13 @@ int
request_firmware(const struct firmware **firmware_p, const char *name,
struct device *device)
return _request_firmware(firmware_p, name, device, true, false);
int ret;
/* Need to pin this module until return */
ret = _request_firmware(firmware_p, name, device, true, false);
return ret;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment