mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] firmware: add missing kfree for work on async call
@ 2015-05-29  0:46 Luis R. Rodriguez
  0 siblings, 0 replies; only message in thread
From: Luis R. Rodriguez @ 2015-05-29  0:46 UTC (permalink / raw)
  To: gregkh
  Cc: linux-kernel, Luis R. Rodriguez, Ming Lei, Seth Forshee, Kyle McMartin

From: "Luis R. Rodriguez" <mcgrof@suse.com>

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>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---

Sorry about that..

 drivers/base/firmware_class.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 8c3aa3c..9c42883 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;
-- 
2.3.2.209.gd67f9d5.dirty


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-29  0:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-29  0:46 [PATCH] firmware: add missing kfree for work on async call Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®