Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1195481

[PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name()

From Vladimir Zapolskiy <vz@mleia.com>
Newsgroups linux.kernel
Subject [PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name()
Date 2015-07-29 22:30 +0200
Message-ID <pRG9c-1VI-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Device resource data allocated with devres_alloc() must be deallocated
by devres_free().

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 drivers/base/firmware_class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 894bda1..8524450 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -443,7 +443,7 @@ static int fw_add_devm_name(struct device *dev, const char *name)
 		return -ENOMEM;
 	fwn->name = kstrdup_const(name, GFP_KERNEL);
 	if (!fwn->name) {
-		kfree(fwn);
+		devres_free(fwn);
 		return -ENOMEM;
 	}
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name() Vladimir Zapolskiy <vz@mleia.com> - 2015-07-29 22:30 +0200
  Re: [PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name() Ming Lei <ming.lei@canonical.com> - 2015-07-30 09:50 +0200

csiph-web