[PATCH 4.9 092/104] staging: greybus: light: Release memory obtained by kasprintf

From: Greg Kroah-Hartman
Date: Fri Dec 22 2017 - 05:09:13 EST


4.9-stable review patch. If anyone has any objections, please let me know.

------------------

From: Arvind Yadav <arvind.yadav.cs@xxxxxxxxx>


[ Upstream commit 04820da21050b35eed68aa046115d810163ead0c ]

Free memory region, if gb_lights_channel_config is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@xxxxxxxxx>
Reviewed-by: Rui Miguel Silva <rmfrfs@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/staging/greybus/light.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -924,6 +924,8 @@ static void __gb_lights_led_unregister(s
return;

led_classdev_unregister(cdev);
+ kfree(cdev->name);
+ cdev->name = NULL;
channel->led = NULL;
}