Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1874537pxb; Mon, 13 Sep 2021 07:20:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3ow4pM/2k7kDVuv/Ok5fAInnAB6lGU1Y/2LzXXhAMBX9KJp/NrRVfhV9TvQTLJCb2lOLi X-Received: by 2002:a6b:f114:: with SMTP id e20mr9242532iog.41.1631542837853; Mon, 13 Sep 2021 07:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631542837; cv=none; d=google.com; s=arc-20160816; b=ATwD8cYoUfd03bhvHARke5heCChMbKCL75/MkP4bK1h6pCA7J7Fvx1K4HInxPh/00L J0oNVmeyFlGGdiUVR+OL/DKEFqKfXBQkiwG4lxfNNCcnXoFs7UJcLBU4lox2OiTuaPcc aSTKzWE+FJIjISvCTZHRstPceHAJqOprebay+CHVHYYYuR7A6FX8Bwa9NpFGXDoE59ec mHvnlJTYDj51X8l+5Z7EPjBQe/v4yW3zgVTmLlcleRWtuAtOHA9fX32hiuTSvUDtfqCa uVUA3z34c/YQUZAKBYCg5P/+s/rlfykzgIM3n/lVjgvAVq+B4Ssl8tvwP99psNEOOxX4 OuDw== 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=vNk35maI5kkER3sDTLjLPDLFTzotJxyqgfwKxZ7Em34=; b=ehSAcDLiDiNMNvGDHG7ZvIrXGqX0p97gOQbumgoYKlZJbnkzxpL7DdrWoClqmmSIUX w17SzQXbHNF0w56nK4z0kZe+QUgaezSQis8Luvmiqtr2pFUebfj3pcNpTya7fo9xEz9p 1p3y1FnPx6tvIhH0Xyi9FLrc3uBrWkPi9EojLTwelrMIfCYt0ThSNJigncS0NylYzQdk 2cTqDE11csCiEnr3N//B2uhsnRTgfAcPP9yK2Oq7yvV6/ZvuCXwAmgfD9RTqP6teJkQq eq7xN4J0I0KvotqWa/BWAVg0UNWbw0u+X52YfPJQX6uyl8nUIaUYd866ktUFyJOYHFSs ow/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ov9mzM8K; 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 k17si7461665iow.29.2021.09.13.07.20.23; Mon, 13 Sep 2021 07:20:37 -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=Ov9mzM8K; 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 S1343632AbhIMOTG (ORCPT + 99 others); Mon, 13 Sep 2021 10:19:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:34056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344794AbhIMOOl (ORCPT ); Mon, 13 Sep 2021 10:14:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 09CBF61359; Mon, 13 Sep 2021 13:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540622; bh=3BRQKf+4m4hF8xbhI2zJqChxuqd8U0J5T0pyXXtX8bc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ov9mzM8KFxjsHvdYXAfQE7PUIHB/2l/CM3nbIKqNRUp4TG10E/WxfaDujbZ18aQpf ODJ6xd6s7ulJUedZkCzHZf+/LE/4dTFaAJgaBbbD6tntVrJDRh5BJi+ugMcm4M57JR 3au7igIc4EgL2GcjObX8ra0/6OMu3Ch/wL+ZO1no= 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.13 235/300] usb: bdc: Fix an error handling path in bdc_probe() when no suitable DMA config is available Date: Mon, 13 Sep 2021 15:14:56 +0200 Message-Id: <20210913131117.298552800@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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 0bef6b3f049b..251db57e51fa 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -560,7 +560,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