Skip to content

Commit

Permalink
firmware: add missing kfree for work on async call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Luis R. Rodriguez authored and Greg Kroah-Hartman committed Jun 1, 2015
1 parent eaa5cd9 commit 303cda0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 303cda0

Please sign in to comment.