All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name()
@ 2015-07-29 20:26 Vladimir Zapolskiy
  2015-07-30  7:48 ` Ming Lei
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2015-07-29 20:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ming Lei; +Cc: linux-kernel

Device resource data allocated with devres_alloc() must be deallocated
by devres_free().

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 drivers/base/firmware_class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 894bda1..8524450 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;
 	}
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name()
  2015-07-29 20:26 [PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name() Vladimir Zapolskiy
@ 2015-07-30  7:48 ` Ming Lei
  0 siblings, 0 replies; 2+ messages in thread
From: Ming Lei @ 2015-07-30  7:48 UTC (permalink / raw)
  To: Vladimir Zapolskiy; +Cc: Greg Kroah-Hartman, Linux Kernel Mailing List

On Wed, Jul 29, 2015 at 4:26 PM, Vladimir Zapolskiy <vz@mleia.com> wrote:
> 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>

> ---
>  drivers/base/firmware_class.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> index 894bda1..8524450 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;
>         }
>
> --
> 2.1.4
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-30  7:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29 20:26 [PATCH] firmware: fix wrong memory deallocation in fw_add_devm_name() Vladimir Zapolskiy
2015-07-30  7:48 ` Ming Lei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.