[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1432860402-18213-1-git-send-email-mcgrof@do-not-panic.com>
Date: Thu, 28 May 2015 17:46:42 -0700
From: "Luis R. Rodriguez" <mcgrof@...not-panic.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
"Luis R. Rodriguez" <mcgrof@...e.com>,
Ming Lei <ming.lei@...onical.com>,
Seth Forshee <seth.forshee@...onical.com>,
Kyle McMartin <kyle@...nel.org>
Subject: [PATCH] firmware: add missing kfree for work on async call
From: "Luis R. Rodriguez" <mcgrof@...e.com>
The recent fix to use kstrdup_const() failed to add a
kfree upon failure of name allocation...
Cc: Ming Lei <ming.lei@...onical.com>
Cc: Seth Forshee <seth.forshee@...onical.com>
Cc: Kyle McMartin <kyle@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@...e.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists