From patchwork Mon May 20 14:51:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 2593711 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 79130DF2A2 for ; Mon, 20 May 2013 15:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932101Ab3ETPCJ (ORCPT ); Mon, 20 May 2013 11:02:09 -0400 Received: from smtp-out-214.synserver.de ([212.40.185.214]:1282 "EHLO smtp-out-209.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932099Ab3ETPCD (ORCPT ); Mon, 20 May 2013 11:02:03 -0400 X-Greylist: delayed 609 seconds by postgrey-1.27 at vger.kernel.org; Mon, 20 May 2013 11:02:03 EDT Received: (qmail 6732 invoked by uid 0); 20 May 2013 14:51:56 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 6266 Received: from ppp-188-174-66-218.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [188.174.66.218] by 217.119.54.77 with SMTP; 20 May 2013 14:51:55 -0000 From: Lars-Peter Clausen To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen , Trilok Soni Subject: [PATCH 6/7] input: pmic8xxx-pwrkey: Pass correct pointer to free_irq() Date: Mon, 20 May 2013 16:51:25 +0200 Message-Id: <1369061486-28226-6-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1369061486-28226-1-git-send-email-lars@metafoo.de> References: <1369061486-28226-1-git-send-email-lars@metafoo.de> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org free_irq() expects the same pointer that was passed to request_irq(), otherwise the IRQ is not freed. The issue was found using the following coccinelle script: @r1@ type T; T devid; @@ request_irq(..., devid) @r2@ type r1.T; T devid; position p; @@ free_irq@p(..., devid) @@ position p != r2.p; @@ *free_irq@p(...) Cc: Trilok Soni Signed-off-by: Lars-Peter Clausen --- drivers/input/misc/pmic8xxx-pwrkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c index afd0af9..b49b738 100644 --- a/drivers/input/misc/pmic8xxx-pwrkey.c +++ b/drivers/input/misc/pmic8xxx-pwrkey.c @@ -175,7 +175,7 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev) return 0; free_press_irq: - free_irq(key_press_irq, NULL); + free_irq(key_press_irq, pwrkey); unreg_input_dev: input_unregister_device(pwr); pwr = NULL;