firmware: add missing kfree for work on async call
The recent fix to use kstrdup_const() failed to add a kfree upon failure of name allocation... Cc: Ming Lei <ming.lei@canonical.com> Cc: Seth Forshee <seth.forshee@canonical.com> Cc: Kyle McMartin <kyle@kernel.org> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
eaa5cd9263
commit
303cda0ea7
@ -1307,8 +1307,10 @@ request_firmware_nowait(
|
||||
|
||||
fw_work->module = module;
|
||||
fw_work->name = kstrdup_const(name, gfp);
|
||||
if (!fw_work->name)
|
||||
if (!fw_work->name) {
|
||||
kfree(fw_work);
|
||||
return -ENOMEM;
|
||||
}
|
||||
fw_work->device = device;
|
||||
fw_work->context = context;
|
||||
fw_work->cont = cont;
|
||||
|
Loading…
Reference in New Issue
Block a user