Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1834342pxb; Mon, 13 Sep 2021 06:35:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXRpSEcrt6fIKX4K4wlUXahGsXyiPo6OyyzmrUMzzJu/+/LJj+Vxai5xFYbno/N341M7vw X-Received: by 2002:a6b:b842:: with SMTP id i63mr9046248iof.115.1631540100738; Mon, 13 Sep 2021 06:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540100; cv=none; d=google.com; s=arc-20160816; b=EtI5kvD27QEd+DNFMaZvsSycr7Elj6FvbzBa/ttwx7J+qkDOl8C3UE+YbVSVy0ZHJB 2a40OeB9zkQrsMblAp30872c2+m8QMIfEfnbG1sCws+f4XjNItRVPCsLeor9lpdTbY4m awkfDhjd41UeafRsOSbIFzZBuGGKMb97HEKPdBAAe5odrhW24XgNNe2Mq5z2F5F5pSq3 bZ6mjTvfhqRE8Tx41BsCEzQxWHKSjdlF/A5YhY8JYGfdCXjJxnDs1Mr60oAiKoW1c+ZF 18G3MxfwTsbgsbiANBrCKdR4fqudYUxPBBW1BCfz5dwvv51F/XPp9YNLWzLh7EEjdGcj mXOw== 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=oATNpHHq6Iv4QwHQ6ZYpkEtm0H37QI+m4WdWeoSM3B8=; b=MhO7G91UhCrHP+/qdq+8hwcsmat5mjIMVddWsMNzTYgGnJjvlH61XPvT8DQUMwhXnf MeWyQIBiOXXlBY/1hTHNWvViVen0X16k3L76mzVcslRRU/nvZpNjoEscWjvNcch0UUPF 4aanysTVF7J5ixFON4Po8NH6ESxh+vZ5JlRNDCcetOo4OYatLFSNWu6K7dBf6dKD2ke9 q+aLZXWmZdhXF5UeGBKZGmza73792yFeHyLaNPmFkMbuxcTlDemAcfuVLVqSwi366A0+ Ekg1FZ+zI2qcJ7arYkR8uHd85UuswuAbU+kxWpKFQodJT1yyvux+lAv8ZaNRhXo3fKzP Klag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1ROGNlVw; 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 a2si6264547ilp.123.2021.09.13.06.34.45; Mon, 13 Sep 2021 06:35:00 -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=1ROGNlVw; 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 S238638AbhIMNdg (ORCPT + 99 others); Mon, 13 Sep 2021 09:33:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:35020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241300AbhIMNXs (ORCPT ); Mon, 13 Sep 2021 09:23:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A05B6103B; Mon, 13 Sep 2021 13:21:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539290; bh=0lVwB8LeeWG1TuWOl4NbDznDnKpNRHATvtpucMkWxFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1ROGNlVwgGZaLBlCMDwOytcQGdcy+3KKdp7AWXeS+/uJjqTQkuz1a/DNmkuGpAOvb Se4vubo5i2btJYT0m0cQv5XoyxkRBM2wK3ZBOIEgo2u99ttGSR3QK7wJzYtnM1P1yy 8ZwisaF5kpPSLOHNvHWccmGLZ5NjT9s0272MFT7s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Christophe JAILLET , Sasha Levin Subject: [PATCH 5.4 113/144] usb: bdc: Fix an error handling path in bdc_probe() when no suitable DMA config is available Date: Mon, 13 Sep 2021 15:14:54 +0200 Message-Id: <20210913131051.716101545@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 d2f42e09393c774ab79088d8e3afcc62b3328fc9 ] If no suitable DMA configuration is available, a previous 'bdc_phy_init()' call must be undone by a corresponding 'bdc_phy_exit()' call. Branch to the existing error handling path instead of returning directly. Fixes: cc29d4f67757 ("usb: bdc: Add support for USB phy") Acked-by: Florian Fainelli Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/0c5910979f39225d5d8fe68c9ab1c147c68ddee1.1629314734.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/bdc/bdc_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index 3d33499db50b..845aead48d85 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -565,7 +565,8 @@ static int bdc_probe(struct platform_device *pdev) if (ret) { dev_err(dev, "No suitable DMA config available, abort\n"); - return -ENOTSUPP; + ret = -ENOTSUPP; + goto phycleanup; } dev_dbg(dev, "Using 32-bit address\n"); } -- 2.30.2