From: Vladimir Zapolskiy Date: Wed, 29 Jul 2015 20:26:28 +0000 (+0300) Subject: firmware: fix wrong memory deallocation in fw_add_devm_name() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a885de67157e8e65b92af2e0a77f6eadd112d0b7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Ming Lei Signed-off-by: Greg Kroah-Hartman --- 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; }