public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vasiliy Kulikov <segooon@gmail.com>
To: kernel-janitors@vger.kernel.org
Cc: Rabin Vincent <rabin.vincent@stericsson.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Wolfram Sang <w.sang@pengutronix.de>,
	Luotao Fu <l.fu@pengutronix.de>,
	Linus Walleij <linus.walleij@stericsson.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] gpio: stmpe: fix error path
Date: Sun, 12 Sep 2010 22:57:19 +0400	[thread overview]
Message-ID: <1284317840-5131-1-git-send-email-segooon@gmail.com> (raw)

Free allocated memory.  Call stmpe_disable() if it was enabled.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
 Compile tested.
 Maybe It needs better error path.

 drivers/gpio/stmpe-gpio.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/stmpe-gpio.c b/drivers/gpio/stmpe-gpio.c
index 65b9960..6e28afa 100644
--- a/drivers/gpio/stmpe-gpio.c
+++ b/drivers/gpio/stmpe-gpio.c
@@ -317,11 +317,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
 
 	ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO);
 	if (ret)
-		return ret;
+		goto out_free;
 
 	ret = stmpe_gpio_irq_init(stmpe_gpio);
 	if (ret)
-		goto out_free;
+		goto out_disable;
 
 	ret = request_threaded_irq(irq, NULL, stmpe_gpio_irq, IRQF_ONESHOT,
 				   "stmpe-gpio", stmpe_gpio);
@@ -347,6 +347,8 @@ out_freeirq:
 	free_irq(irq, stmpe_gpio);
 out_removeirq:
 	stmpe_gpio_irq_remove(stmpe_gpio);
+out_disable:
+	stmpe_disable(stmpe, STMPE_BLOCK_GPIO);
 out_free:
 	kfree(stmpe_gpio);
 	return ret;
-- 
1.7.0.4


             reply	other threads:[~2010-09-12 18:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-12 18:57 Vasiliy Kulikov [this message]
2010-09-13 19:37 ` [PATCH] gpio: stmpe: fix error path Wolfram Sang
2010-09-18 11:21   ` Vasiliy Kulikov
2010-09-14  3:49 ` Rabin Vincent
2010-09-27 10:01 ` Samuel Ortiz

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=1284317840-5131-1-git-send-email-segooon@gmail.com \
    --to=segooon@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=l.fu@pengutronix.de \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabin.vincent@stericsson.com \
    --cc=sameo@linux.intel.com \
    --cc=w.sang@pengutronix.de \
    /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