Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp100107pxb; Mon, 13 Sep 2021 14:05:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySpEzS69+p6/IVQWE4D45rvZtDe2mxLRvihlt4GPguWJor40u7Zn/2S5FWIRM1vDOifzAl X-Received: by 2002:a05:6e02:1103:: with SMTP id u3mr9991805ilk.233.1631567139121; Mon, 13 Sep 2021 14:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631567139; cv=none; d=google.com; s=arc-20160816; b=cCw9HtoWQwk68pfrJdkke/xU2qskJ1SU+T9wU7RBac5mwnNLNVHXIaco9D1jqzcpe4 McF+Hc0VOiwn4SZsZZJ9mWA9LCr6pbinzUNHb6zEFPcKkg/zBaaZv6Y8iMwzQM92rF/F c9Lqe5ZXo12x/eopJS/FQRHSwm5YxxJbg6cORcWFlOe+LUB99oYr0eV1iZnJkMF7v7nE DjCFmxhDG82WrsmWuUr7dMzwvHBNZpEkTYD4jrcBacHzkhQQIYbJFSTgbbFSnFzgXVt4 YiYYZosgaNl7I7PLEW3woa9XusDx79S8qk1S1/msNGl9AR84TMrZTkRaYQOPGpbI+azC 3Rpg== 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=lnRntnnQtElVIDRwznMPi+TWar+NSe4qiFwys00Wsex9veccSKWHDrTbL8buw5Jz8E bwmkxqMJO8Eu/4uk1Q6KhninutIoXc62Df7ZcC+mgwYtAB+2CfpFA/0M4JjWTmI6TgJB wOLERT159sJOVVG9Xgj62SOwjaEmSzNqjDMK9AxNDQNLOGGnMjcynT1gvVj2rHB3sbPB X3SlaJxp5S4FQ3r2bhWXeXpx8685+W+vdSmoqEcJqdoGyINeRI17SXUaD1a/f2MGPaD9 YMdkvZlTFrgymNYQ+nlgMPMpU6sXJU4/NnvYXUH2GVzxogZrVCc2DBl3mJMagOJKDgcW SOyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OCl8rVFF; 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 t195si8994714iof.69.2021.09.13.14.05.27; Mon, 13 Sep 2021 14:05:39 -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=OCl8rVFF; 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 S244208AbhIMNtO (ORCPT + 99 others); Mon, 13 Sep 2021 09:49:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:44480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243649AbhIMNou (ORCPT ); Mon, 13 Sep 2021 09:44:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF79561527; Mon, 13 Sep 2021 13:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539872; bh=3BRQKf+4m4hF8xbhI2zJqChxuqd8U0J5T0pyXXtX8bc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OCl8rVFFy/d9Fc6RRBX7lnIF5VoNWmi+HRikhgd6V61FfIBw2fJg3iNBuQ7Jumwz4 6Hbl5H1/iIsYjxExuVsvW4cBeGUujWI80hJNTKo75eYCErxQD8vcoknctSSu/hx9/l lYKHgEbIiykXeNm+puk7XOXQJ4KLwimNvMKonXZY= 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.10 194/236] usb: bdc: Fix an error handling path in bdc_probe() when no suitable DMA config is available Date: Mon, 13 Sep 2021 15:14:59 +0200 Message-Id: <20210913131106.980621809@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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