staging: greybus: light: Release memory obtained by kasprintf

Free memory region, if gb_lights_channel_config is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Arvind Yadav 2017-09-23 13:25:30 +05:30 committed by Greg Kroah-Hartman
parent 63342e75e6
commit 04820da210
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}