From patchwork Thu Jul 14 02:09:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 973942 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6E2AJsR002149 for ; Thu, 14 Jul 2011 02:10:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752156Ab1GNCKB (ORCPT ); Wed, 13 Jul 2011 22:10:01 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:53413 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752092Ab1GNCKA (ORCPT ); Wed, 13 Jul 2011 22:10:00 -0400 Received: by yxi11 with SMTP id 11so2685469yxi.19 for ; Wed, 13 Jul 2011 19:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=2dQK/Gcy6zLTt7BjR1c9GmPEQW4OjV6aEAAJ/SBkmLE=; b=EDRsHl3PaUYixMkowkWhpKBKYHgo4BCjTsXpbHVLHgRg+xSIWco0ZCczWICF+W+X1I SAODmIMqJ0ir+RxvMiyrsbQRGZBiTNdnASAJZpPp436DVXo+LknAfCaD6ltTCV+RR7e3 bjocwZ9PJVsxYSjbSPq3tFSmLDXRK551sZtvU= Received: by 10.236.184.10 with SMTP id r10mr1062006yhm.67.1310609399932; Wed, 13 Jul 2011 19:09:59 -0700 (PDT) Received: from [218.172.233.152] (218-172-233-152.dynamic.hinet.net [218.172.233.152]) by mx.google.com with ESMTPS id c63sm5204213yhe.60.2011.07.13.19.09.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jul 2011 19:09:58 -0700 (PDT) Subject: [PATCH] Input: pmic8xxx-keypad - fix a leak of the IRQ during init failure From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Trilok Soni , Anirudh Ghayal , Dmitry Torokhov , Samuel Ortiz , linux-input@vger.kernel.org Date: Thu, 14 Jul 2011 10:09:51 +0800 Message-ID: <1310609391.14393.1.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 14 Jul 2011 02:10:20 +0000 (UTC) Make sure we are passing the same cookie in all calls to request_any_context_irq() and free_irq(). Signed-off-by: Axel Lin Acked-by: Anirudh Ghayal --- drivers/input/keyboard/pmic8xxx-keypad.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c index 6229c3e..e7cc51d 100644 --- a/drivers/input/keyboard/pmic8xxx-keypad.c +++ b/drivers/input/keyboard/pmic8xxx-keypad.c @@ -700,9 +700,9 @@ static int __devinit pmic8xxx_kp_probe(struct platform_device *pdev) return 0; err_pmic_reg_read: - free_irq(kp->key_stuck_irq, NULL); + free_irq(kp->key_stuck_irq, kp); err_req_stuck_irq: - free_irq(kp->key_sense_irq, NULL); + free_irq(kp->key_sense_irq, kp); err_gpio_config: err_get_irq: input_free_device(kp->input); @@ -717,8 +717,8 @@ static int __devexit pmic8xxx_kp_remove(struct platform_device *pdev) struct pmic8xxx_kp *kp = platform_get_drvdata(pdev); device_init_wakeup(&pdev->dev, 0); - free_irq(kp->key_stuck_irq, NULL); - free_irq(kp->key_sense_irq, NULL); + free_irq(kp->key_stuck_irq, kp); + free_irq(kp->key_sense_irq, kp); input_unregister_device(kp->input); kfree(kp);