diff options
author | Luis R. Rodriguez <mcgrof@suse.com> | 2015-05-28 20:46:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-31 21:22:34 -0400 |
commit | 303cda0ea7c1c33701812ccb80d37083a4093c7c (patch) | |
tree | 29412681ec203464a1c2b6493b40a565a17a328d /drivers/base/firmware_class.c | |
parent | eaa5cd926345f86e9df1eb6b0490da539f5ce7d0 (diff) |
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.c | 4 |
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( | |||
1307 | 1307 | ||
1308 | fw_work->module = module; | 1308 | fw_work->module = module; |
1309 | fw_work->name = kstrdup_const(name, gfp); | 1309 | fw_work->name = kstrdup_const(name, gfp); |
1310 | if (!fw_work->name) | 1310 | if (!fw_work->name) { |
1311 | kfree(fw_work); | ||
1311 | return -ENOMEM; | 1312 | return -ENOMEM; |
1313 | } | ||
1312 | fw_work->device = device; | 1314 | fw_work->device = device; |
1313 | fw_work->context = context; | 1315 | fw_work->context = context; |
1314 | fw_work->cont = cont; | 1316 | fw_work->cont = cont; |