From: Arvind Yadav Date: Sat, 23 Sep 2017 07:55:30 +0000 (+0530) Subject: staging: greybus: light: Release memory obtained by kasprintf X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ae35e16e0a57da2a7aa8631c8929dd79bac74bde;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: greybus: light: Release memory obtained by kasprintf [ Upstream commit 04820da21050b35eed68aa046115d810163ead0c ] Free memory region, if gb_lights_channel_config is not successful. Signed-off-by: Arvind Yadav Reviewed-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 3f4148c92308..0f538b8c3a07 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; }