summaryrefslogtreecommitdiff
path: root/drivers/base/firmware_class.c
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2015-07-29 23:26:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-06 01:18:26 +0300
commita885de67157e8e65b92af2e0a77f6eadd112d0b7 (patch)
tree44bbcfa367596ce5c16c85f165fd654747d32368 /drivers/base/firmware_class.c
parent223e8f01b072152cc4336e7dcb1cf8c21ab34432 (diff)
downloadlinux-a885de67157e8e65b92af2e0a77f6eadd112d0b7.tar.xz
firmware: fix wrong memory deallocation in fw_add_devm_name()
Device resource data allocated with devres_alloc() must be deallocated by devres_free(). Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Ming Lei <ming.lei@canonical.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 894bda114224..8524450e75bd 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;
}