firmware: fix wrong memory deallocation in fw_add_devm_name()
PATCH 1/1 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 <[email protected]>
--- drivers/base/firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/firmware_class.c +1 -1
@@ -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 ; }
Signature · 1 line
2.1.4
Quoted 4 lines · Vladimir Zapolskiy
Device resource data allocated with
devres_alloc()must be deallocated bydevres_free().Signed-off-by Vladimir Zapolskiy <[email protected]>
Acked-by Ming Lei <[email protected]>
Quoted 20 lines
--- drivers/base/firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/firmware_class.c +1
-2@@ -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