Commit a885de67 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Greg Kroah-Hartman

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: default avatarVladimir Zapolskiy <vz@mleia.com>
Acked-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 223e8f01
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment