lkml.org 
[lkml]   [2012]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] leds-88pm860x: use the goto label at data->port
Date
at the goto lable out: we are doing free of the led data, and returning ret.
the same we are doing at the data->port < 0 case, so use the goto end and
assign ret to -EINVAL. this will make the common err path for the
data->port and led_classdev_register functions.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---
drivers/leds/leds-88pm860x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c
index 5b61aaf..538aaa3 100644
--- a/drivers/leds/leds-88pm860x.c
+++ b/drivers/leds/leds-88pm860x.c
@@ -220,8 +220,8 @@ static int pm860x_led_probe(struct platform_device *pdev)
data->port = pdata->flags;
if (data->port < 0) {
dev_err(&pdev->dev, "check device failed\n");
- kfree(data);
- return -EINVAL;
+ ret = -EINVAL;
+ goto out;
}

data->current_brightness = 0;
--
1.7.9.5


\
 
 \ /
  Last update: 2012-07-02 11:02    [W:0.048 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site