Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4611279pxj; Wed, 12 May 2021 09:12:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyOgVZ86/vtmr+DBNKVE3BGEmCctDF5ta9RZH53/OG2MHXR1BefI58ho6fbxBIlIx9x9s1 X-Received: by 2002:a17:906:14c1:: with SMTP id y1mr39546954ejc.481.1620835971631; Wed, 12 May 2021 09:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835971; cv=none; d=google.com; s=arc-20160816; b=uS5HJSUQC77ZzXua+l6106yvAp+RhWJbSxemMvJM1vKyVXIRBeV4qjuzjDN4AJDUV4 O8hB6MK6vtW23jcrFE+48VKtvuL3Lbzkgb8uFK0ctBFuBnrb0OMpAO4+0d5urpOcLGC3 rzFBTZ/vx/UwrDKaLRBwR+Ct3XvqItcN+YYCLmk5vIH6NYEJRSphb5V6xs7L1H1lX/ws oYBTNArKfBLlnp9A3C9p4dhtsn7D51OHU8z+YErcPHWVbyQzwcBia5l94J0Iz9o5jsWN a2e8DvcQa/6mMdMk/1u2piFKM2u00TCGK9ISzEAqZLORbkhU5VqQlbU7KbDFZFIJ9/Ls R4Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7hoWNcfAjinHjDZ8rup/OzAg6qwhTbF/Lgz+tCzq06A=; b=Us7a9jGUm+Y5f64JJNNNSR669j9g3kfjVSswub/PPDdM1YYxToRx/wqFz2FsPvTfwx arljd4VFz4kgCLCflvZyySVNv6PvjWNUjF3r7Hhd/PLM6BRz7Oa5L7hMt+A/jH2vDHZ1 kAombwOd54PeCr2qr+GAHbVQlalPxEJtW9mdbKWSR02WW9WdRSGGbGZnFm0FO/u4So15 bkX+gIBnOtLvD3k255QfR7weWpkoOE3csfEdq4n6bcL6uvoBeDZw2KsbusQfJLSp86OR /+Q8wNusPwKlbhTLPuGnl6t2FrgnbJMVKEmTgG1NBaVUlHBWf1+vKfDsWhK0fvAx7PnK wqzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iGg3CrUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si101972eds.560.2021.05.12.09.12.08; Wed, 12 May 2021 09:12:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iGg3CrUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238876AbhELQGm (ORCPT + 99 others); Wed, 12 May 2021 12:06:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:38874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234933AbhELPZ4 (ORCPT ); Wed, 12 May 2021 11:25:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2412F6162A; Wed, 12 May 2021 15:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832266; bh=EuN0jmkZAT174ZxhbQczPDZMg+vgNKSeYtDiRKZhCno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGg3CrUo+6XisieAru7VI5a3BHIrhChwjsZdyPxqcYBa9pretU644uDyxMdgfc5Z0 rOASYnrBz9HZxRD4jRV4zHbgwAIR+Xt2dOM7ziXG3C+G1FrN2eH9RepTYpt9treYdp M7W+rseNzAHeq/NSu9XjV88xSE+RwL6ZgpEGk+TQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.10 182/530] usb: gadget: s3c: Fix incorrect resources releasing Date: Wed, 12 May 2021 16:44:52 +0200 Message-Id: <20210512144825.812719482@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 42067ccd9eb2077979ac3ce8b7b95c694bd09e14 ] Since commit 188db4435ac6 ("usb: gadget: s3c: use platform resources"), 'request_mem_region()' and 'ioremap()' are no more used, so they don't need to be undone in the error handling path of the probe and in the remove function. Remove these calls and the unneeded 'rsrc_start' and 'rsrc_len' global variables. Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources") Signed-off-by: Christophe JAILLET Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/b317638464f188159bd8eea44427dd359e480625.1616830026.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/s3c2410_udc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index 1d3ebb07ccd4..b81979b3bdb6 100644 --- a/drivers/usb/gadget/udc/s3c2410_udc.c +++ b/drivers/usb/gadget/udc/s3c2410_udc.c @@ -54,8 +54,6 @@ static struct clk *udc_clock; static struct clk *usb_bus_clock; static void __iomem *base_addr; static int irq_usbd; -static u64 rsrc_start; -static u64 rsrc_len; static struct dentry *s3c2410_udc_debugfs_root; static inline u32 udc_read(u32 reg) @@ -1775,7 +1773,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev) base_addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base_addr)) { retval = PTR_ERR(base_addr); - goto err_mem; + goto err; } the_controller = udc; @@ -1793,7 +1791,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev) if (retval != 0) { dev_err(dev, "cannot get irq %i, err %d\n", irq_usbd, retval); retval = -EBUSY; - goto err_map; + goto err; } dev_dbg(dev, "got irq %i\n", irq_usbd); @@ -1864,10 +1862,7 @@ err_gpio_claim: gpio_free(udc_info->vbus_pin); err_int: free_irq(irq_usbd, udc); -err_map: - iounmap(base_addr); -err_mem: - release_mem_region(rsrc_start, rsrc_len); +err: return retval; } @@ -1899,9 +1894,6 @@ static int s3c2410_udc_remove(struct platform_device *pdev) free_irq(irq_usbd, udc); - iounmap(base_addr); - release_mem_region(rsrc_start, rsrc_len); - if (!IS_ERR(udc_clock) && udc_clock != NULL) { clk_disable_unprepare(udc_clock); clk_put(udc_clock); -- 2.30.2