From: Devendra Naga <devendra.aaru@gmail.com>
To: Bryan Wu <bryan.wu@canonical.com>,
Richard Purdie <rpurdie@rpsys.net>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Devendra Naga <devendra.aaru@gmail.com>
Subject: [PATCH] leds-88pm860x: use the goto label at data->port
Date: Mon, 2 Jul 2012 13:52:12 +0530 [thread overview]
Message-ID: <1341217332-21153-1-git-send-email-devendra.aaru@gmail.com> (raw)
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
next reply other threads:[~2012-07-02 8:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-02 8:22 Devendra Naga [this message]
2012-07-02 9:05 ` [PATCH] leds-88pm860x: use the goto label at data->port Bryan Wu
2012-07-02 9:16 ` devendra.aaru
2012-07-02 9:58 ` Bryan Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341217332-21153-1-git-send-email-devendra.aaru@gmail.com \
--to=devendra.aaru@gmail.com \
--cc=bryan.wu@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox