summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@suse.com>2015-05-28 17:46:42 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-01 10:22:34 +0900
commit303cda0ea7c1c33701812ccb80d37083a4093c7c (patch)
tree29412681ec203464a1c2b6493b40a565a17a328d /drivers/base
parenteaa5cd926345f86e9df1eb6b0490da539f5ce7d0 (diff)
downloadlinux-303cda0ea7c1c33701812ccb80d37083a4093c7c.tar.bz2
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>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/firmware_class.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 8c3aa3c2e94e..9c4288362a8e 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -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;