mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
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>
This commit is contained in:
parent
223e8f01b0
commit
a885de6715
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user