Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1737975 > unrolled thread

[PATCH v3] staging: greybus: light: Release memory obtained by kasprintf

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-09-23 10:00 +0200
Last post2017-09-25 16:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3] staging: greybus: light: Release memory obtained by kasprintf Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-09-23 10:00 +0200
    Re: [PATCH v3] staging: greybus: light: Release memory obtained by  kasprintf Rui Miguel Silva <rmfrfs@gmail.com> - 2017-09-25 16:30 +0200

#1737975 — [PATCH v3] staging: greybus: light: Release memory obtained by kasprintf

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-09-23 10:00 +0200
Subject[PATCH v3] staging: greybus: light: Release memory obtained by kasprintf
Message-ID<usNvX-il-3@gated-at.bofh.it>
Free memory region, if gb_lights_channel_config is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2:
            - Subject line changed.
            - add kfree in __gb_lights_led_unregister().
            - No need to check return value of gb_lights_channel_flash_config().

changes ib v3:
            - separate patch for "No need to check return value of
              gb_lights_channel_flash_config()".

 drivers/staging/greybus/light.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index 3f4148c..0f538b8 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -925,6 +925,8 @@ static void __gb_lights_led_unregister(struct gb_channel *channel)
 		return;
 
 	led_classdev_unregister(cdev);
+	kfree(cdev->name);
+	cdev->name = NULL;
 	channel->led = NULL;
 }
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1739091 — Re: [PATCH v3] staging: greybus: light: Release memory obtained by kasprintf

FromRui Miguel Silva <rmfrfs@gmail.com>
Date2017-09-25 16:30 +0200
SubjectRe: [PATCH v3] staging: greybus: light: Release memory obtained by kasprintf
Message-ID<utCyu-7ys-23@gated-at.bofh.it>
In reply to#1737975
Hi,
On Sat, Sep 23, 2017 at 01:25:30PM +0530, Arvind Yadav wrote:
> Free memory region, if gb_lights_channel_config is not successful.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Thanks for the patch, looks good to me.

Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>

---
Cheers,
	Rui

> ---
> changes in v2:
>             - Subject line changed.
>             - add kfree in __gb_lights_led_unregister().
>             - No need to check return value of gb_lights_channel_flash_config().
> 
> changes ib v3:
>             - separate patch for "No need to check return value of
>               gb_lights_channel_flash_config()".
> 
>  drivers/staging/greybus/light.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
> index 3f4148c..0f538b8 100644
> --- a/drivers/staging/greybus/light.c
> +++ b/drivers/staging/greybus/light.c
> @@ -925,6 +925,8 @@ static void __gb_lights_led_unregister(struct gb_channel *channel)
>  		return;
>  
>  	led_classdev_unregister(cdev);
> +	kfree(cdev->name);
> +	cdev->name = NULL;
>  	channel->led = NULL;
>  }
>  
> -- 
> 2.7.4
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web