From patchwork Tue Sep 21 11:49:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjugk manjugk X-Patchwork-Id: 196882 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8LBoPlb000799 for ; Tue, 21 Sep 2010 11:50:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752398Ab0IULtz (ORCPT ); Tue, 21 Sep 2010 07:49:55 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:40625 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752179Ab0IULtz (ORCPT ); Tue, 21 Sep 2010 07:49:55 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o8LBnpNj022651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Sep 2010 06:49:51 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o8LBnp7F005018; Tue, 21 Sep 2010 06:49:51 -0500 (CDT) Received: from localhost (dfl-61.apr.dhcp.ti.com [172.24.137.86]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o8LBnmf11147; Tue, 21 Sep 2010 06:49:49 -0500 (CDT) From: "G, Manjunath Kondaiah" To: linux-omap@vger.kernel.org Cc: linux-input@vger.kernel.org, Dmitry Torokhov , linux-arm-kernel@lists.infradead.org, Tony Lindgren Subject: [PATCH v2] OMAP3: Keypad: Fix failure exit path in probe Date: Tue, 21 Sep 2010 17:19:30 +0530 Message-Id: <1285069770-4261-1-git-send-email-manjugk@ti.com> X-Mailer: git-send-email 1.7.0.4 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 21 Sep 2010 11:50:26 +0000 (UTC) diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index fb16b5e..39a9f30 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c @@ -347,8 +347,7 @@ static int __devinit twl4030_kp_probe(struct platform_device *pdev) kp = kzalloc(sizeof(*kp), GFP_KERNEL); input = input_allocate_device(); if (!kp || !input) { - error = -ENOMEM; - goto err1; + return -ENOMEM; } /* Get the debug Device */ @@ -406,23 +405,22 @@ static int __devinit twl4030_kp_probe(struct platform_device *pdev) if (error) { dev_info(kp->dbg_dev, "request_irq failed for irq no=%d\n", kp->irq); - goto err3; + goto err2; } /* Enable KP and TO interrupts now. */ reg = (u8) ~(KEYP_IMR1_KP | KEYP_IMR1_TO); if (twl4030_kpwrite_u8(kp, reg, KEYP_IMR1)) { error = -EIO; - goto err4; + goto err3; } platform_set_drvdata(pdev, kp); return 0; -err4: +err3: /* mask all events - we don't care about the result */ (void) twl4030_kpwrite_u8(kp, 0xff, KEYP_IMR1); -err3: free_irq(kp->irq, NULL); err2: input_unregister_device(input);