Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbbFNL6j (ORCPT ); Sun, 14 Jun 2015 07:58:39 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34819 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbbFNL6f (ORCPT ); Sun, 14 Jun 2015 07:58:35 -0400 From: Takeshi Yoshimura To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , patches@opensource.wolfsonmicro.com, linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Takeshi Yoshimura Subject: [PATCH 1/1] wm831x_power: Fix off-by-one at free_irq() Date: Sun, 14 Jun 2015 20:55:18 +0900 Message-Id: <1434282918-6980-1-git-send-email-yos@sslab.ics.keio.ac.jp> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 943 Lines: 29 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/