提交 a885de67 编写于 作者: V Vladimir Zapolskiy 提交者: 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: NVladimir Zapolskiy <vz@mleia.com>
Acked-by: NMing Lei <ming.lei@canonical.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册