diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-09-23 13:25:30 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-09-29 15:39:22 +0200 |
commit | 04820da21050b35eed68aa046115d810163ead0c (patch) | |
tree | 9f8ae14637a6ea293d8708a3412c133154afa6d9 /drivers/staging/greybus | |
parent | 63342e75e661c1b71a0f33a4329726bcf383b342 (diff) | |
download | linux-stable-04820da21050b35eed68aa046115d810163ead0c.tar.gz linux-stable-04820da21050b35eed68aa046115d810163ead0c.tar.bz2 linux-stable-04820da21050b35eed68aa046115d810163ead0c.zip |
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>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r-- | drivers/staging/greybus/light.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |