Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752448Ab3EIGG1 (ORCPT ); Thu, 9 May 2013 02:06:27 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:34176 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752237Ab3EIGGY (ORCPT ); Thu, 9 May 2013 02:06:24 -0400 From: Libo Chen To: , , CC: , , , , Libo Chen Subject: [PATCH RESEND 2/4] usb: isp1760-if: fix memleak when platform_get_resource fail Date: Thu, 9 May 2013 14:05:35 +0800 Message-ID: <1368079537-15328-3-git-send-email-libo.chen@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1368079537-15328-1-git-send-email-libo.chen@huawei.com> References: <1368079537-15328-1-git-send-email-libo.chen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.135.72.158] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 984 Lines: 32 When platform_get_resource fail, we should release_mem_region Signed-off-by: Libo Chen --- drivers/usb/host/isp1760-if.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index bbb791b..a13709e 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c @@ -373,8 +373,10 @@ static int isp1760_plat_probe(struct platform_device *pdev) irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq_res) { pr_warning("isp1760: IRQ resource not available\n"); - return -ENODEV; + ret = -ENODEV; + goto cleanup; } + irqflags |= irq_res->flags & IRQF_TRIGGER_MASK; if (priv) { -- 1.7.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/