summaryrefslogtreecommitdiffstats
path: root/drivers/base/firmware_class.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@suse.com>2015-05-29 02:46:42 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-01 03:22:34 +0200
commit303cda0ea7c1c33701812ccb80d37083a4093c7c (patch)
tree29412681ec203464a1c2b6493b40a565a17a328d /drivers/base/firmware_class.c
parentfs: sysfs: don't pass count == 0 to bin file readers (diff)
downloadlinux-303cda0ea7c1c33701812ccb80d37083a4093c7c.tar.xz
linux-303cda0ea7c1c33701812ccb80d37083a4093c7c.zip
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/firmware_class.c')
-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;