From patchwork Wed Aug 27 10:57:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pramod Gurav X-Patchwork-Id: 4787491 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1B6F49F383 for ; Wed, 27 Aug 2014 10:54:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48F342015A for ; Wed, 27 Aug 2014 10:54:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 300F220115 for ; Wed, 27 Aug 2014 10:54:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755720AbaH0KyM (ORCPT ); Wed, 27 Aug 2014 06:54:12 -0400 Received: from smtp86.ord1c.emailsrvr.com ([108.166.43.86]:58342 "EHLO smtp86.ord1c.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755388AbaH0KyL (ORCPT ); Wed, 27 Aug 2014 06:54:11 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp19.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id C1D8018068F; Wed, 27 Aug 2014 06:54:10 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp19.relay.ord1c.emailsrvr.com (Authenticated sender: pramod.gurav-AT-smartplayin.com) with ESMTPSA id AAAD718069D; Wed, 27 Aug 2014 06:54:08 -0400 (EDT) X-Sender-Id: pramod.gurav@smartplayin.com Received: from SPINITLTDL00278.smartplayin.local ([UNAVAILABLE]. [220.227.185.53]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:465 (trex/5.2.10); Wed, 27 Aug 2014 10:54:10 GMT From: Pramod Gurav To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Pramod Gurav , "Ivan T. Ivanov" , Bjorn Andersson , Linus Walleij Subject: [PATCH] pinctrl: qcom: Release pin ranges when gpiochip_irqchip_add fails Date: Wed, 27 Aug 2014 16:27:29 +0530 Message-Id: <1409137049-15848-1-git-send-email-pramod.gurav@smartplayin.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patches adds a call to gpiochip_remove_pin_ranges when gpiochip_irqchip_add fails to release memory allocated for pin_ranges. CC: Ivan T. Ivanov CC: Bjorn Andersson CC: Linus Walleij Signed-off-by: Pramod Gurav --- drivers/pinctrl/qcom/pinctrl-msm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index f4e4f8f..aa34b5a 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -845,6 +845,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl) IRQ_TYPE_NONE); if (ret) { dev_err(pctrl->dev, "Failed to add irqchip to gpiochip\n"); + gpiochip_remove_pin_ranges(chip); return -ENOSYS; }