mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] staging: greybus: light: Release memory obtained by kasprintf
@ 2017-09-23  7:55 Arvind Yadav
  2017-09-25 14:19 ` Rui Miguel Silva
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-09-23  7:55 UTC (permalink / raw)
  To: rmfrfs, johan, elder, gregkh; +Cc: greybus-dev, devel, linux-kernel

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

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

end of thread, other threads:[~2017-09-25 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-23  7:55 [PATCH v3] staging: greybus: light: Release memory obtained by kasprintf Arvind Yadav
2017-09-25 14:19 ` Rui Miguel Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®