Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1736587
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] media: staging: greybus: Release memory obtained by kasprintf |
| Date | 2017-09-21 13:40 +0200 |
| Message-ID | <us7ZN-o2-21@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Free memory region, if gb_lights_channel_config is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> --- drivers/staging/greybus/light.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 3f4148c..b00d47c 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -984,7 +984,7 @@ static int gb_lights_channel_config(struct gb_light *light, ret = channel_attr_groups_set(channel, cdev); if (ret < 0) - return ret; + goto err; gb_lights_led_operations_set(channel, cdev); @@ -994,15 +994,18 @@ static int gb_lights_channel_config(struct gb_light *light, * configurations. */ if (!is_channel_flash(channel)) - return ret; + goto err; light->has_flash = true; ret = gb_lights_channel_flash_config(channel); if (ret < 0) - return ret; + goto err; return ret; +err: + kfree(cdev->name); + return ret; } static int gb_lights_light_config(struct gb_lights *glights, u8 id) -- 1.9.1
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] media: staging: greybus: Release memory obtained by kasprintf Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-09-21 13:40 +0200
Re: [PATCH] media: staging: greybus: Release memory obtained by kasprintf Dan Carpenter <dan.carpenter@oracle.com> - 2017-09-21 15:00 +0200
Re: [PATCH] media: staging: greybus: Release memory obtained by kasprintf Rui Miguel Silva <rmfrfs@gmail.com> - 2017-09-21 16:00 +0200
csiph-web