mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp>
To: Sebastian Reichel <sre@kernel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	patches@opensource.wolfsonmicro.com, linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp>
Subject: [PATCH 1/1] wm831x_power: Fix off-by-one at free_irq()
Date: Sun, 14 Jun 2015 20:55:18 +0900	[thread overview]
Message-ID: <1434282918-6980-1-git-send-email-yos@sslab.ics.keio.ac.jp> (raw)

An error handling in wm831x_power_probe() mistakenly frees a failed-to-
request irq as well as other irqs. I added missing decrement of the loop
counter.

Signed-off-by: Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp>
---
 drivers/power/wm831x_power.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/wm831x_power.c b/drivers/power/wm831x_power.c
index 0161bda..db11ae6 100644
--- a/drivers/power/wm831x_power.c
+++ b/drivers/power/wm831x_power.c
@@ -609,6 +609,7 @@ static int wm831x_power_probe(struct platform_device *pdev)
 	return ret;
 
 err_bat_irq:
+	--i;
 	for (; i >= 0; i--) {
 		irq = platform_get_irq_byname(pdev, wm831x_bat_irqs[i]);
 		free_irq(irq, power);
-- 
1.9.1


             reply	other threads:[~2015-06-14 11:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 11:55 Takeshi Yoshimura [this message]
2015-06-14 13:24 ` Charles Keepax
2015-06-15 10:32 ` Sebastian Reichel

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=1434282918-6980-1-git-send-email-yos@sslab.ics.keio.ac.jp \
    --to=yos@sslab.ics.keio.ac.jp \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=sre@kernel.org \
    /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

all inboxes | Powered by JetHome®