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:
Luis R. Rodriguez 2015-05-28 17:46:42 -07:00 committed by Greg Kroah-Hartman
parent eaa5cd9263
commit 303cda0ea7

View File

@ -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;