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:
parent
63342e75e6
commit
04820da210
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue