Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5452799pxb; Sun, 7 Nov 2021 12:38:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCIMj1IDWUxCRFGw319GzXJwHS+nehNi9dv9KhdgfJjuvGVMYkPmcGL/mFdJ+J5jq245FB X-Received: by 2002:a17:906:c9d0:: with SMTP id hk16mr89587569ejb.109.1636317498233; Sun, 07 Nov 2021 12:38:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636317498; cv=none; d=google.com; s=arc-20160816; b=TwMDVhJv5KfE+tjnYlHzUtXKjbiE67Egv9/1o/Arh2qNAQiRZGnYsimQLdy7SWCCN9 tDe9I4V2uB47gRWW555BrUzgiDiRx3rG1qTEZ4RPxrBbF36KSN4j1IxxU6ZKE82Akmf2 hrlgHLKEIht6GoxynktgaUbYq9YAP1tpFNmsb97QteEqRoyUfg4L1DqW4QU7DVjQQP2V WSM08qLq0BcDsZ8kKpaYOfLXyiCOSFmwvfTSp4pCbTZz8f3to0gKpL4RktKRp7oo4Ywi CSj7LoHXc0DpTm3R/3z1NZcb3iKF81rCsprjYkHA0lKPV3uZMFxL2PXfkMekkcV1bKvQ Oo+Q== 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 :message-id:date:subject:cc:to:from; bh=Vd/MEmVq3Q5Ipd9FLPVf81/vmlCrh6lK93CHRwxKc/Y=; b=A1MS/IzlWiXISu3sBH1VmZOH6ayeCg6+s8VFGkod6c0o9F0V+aTnQyXEscGKH1xMpS uMrkVeseqXj3wmOqW3LrC+Fyvfu/ptG84lylNYTLA5TPebumALktwpqVOiViA8cnt0vP 31QxJrrlfrzInfIENHKJwPsKjMFvPoXdPip2suxNGtxXd/jUqHp0aBk7dGeppQfjYyTr UZ0SgyZEvZZfeldof8urpKJF8HiI68FsqZ5Q7AVbsxXKSBR+B20/8rhs6HqpNAcYZhYZ Z84GU2z5PtnCxFaKa8s2XcULdSG3egwBPdBgdYf9LsQwHJACi0o8zKliFFJds6yDK8Gh L+QA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si19113446edt.479.2021.11.07.12.37.54; Sun, 07 Nov 2021 12:38:18 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235761AbhKGQ2i (ORCPT + 99 others); Sun, 7 Nov 2021 11:28:38 -0500 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:65292 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234632AbhKGQ2h (ORCPT ); Sun, 7 Nov 2021 11:28:37 -0500 Received: from pop-os.home ([86.243.171.122]) by smtp.orange.fr with ESMTPA id jkzNmTDaKf6fnjkzNmDULC; Sun, 07 Nov 2021 17:25:53 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sun, 07 Nov 2021 17:25:53 +0100 X-ME-IP: 86.243.171.122 From: Christophe JAILLET To: balbi@kernel.org, gregkh@linuxfoundation.org, michal.simek@xilinx.com, lee.jones@linaro.org, jiapeng.chong@linux.alibaba.com, abaci-bugfix@linux.alibaba.com, shubhrajyoti.datta@xilinx.com Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] usb: gadget: udc-xilinx: Fix an error handling path in 'xudc_probe()' Date: Sun, 7 Nov 2021 17:25:48 +0100 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A successful 'clk_prepare_enable()' call should be balanced by a corresponding 'clk_disable_unprepare()' call in the error handling path of the probe, as already done in the remove function. Fixes: 24749229211c ("usb: gadget: udc-xilinx: Add clock support") Signed-off-by: Christophe JAILLET --- drivers/usb/gadget/udc/udc-xilinx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index f5ca670776a3..857159dd5ae0 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -2136,7 +2136,7 @@ static int xudc_probe(struct platform_device *pdev) ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget); if (ret) - goto fail; + goto err_disable_unprepare_clk; udc->dev = &udc->gadget.dev; @@ -2155,6 +2155,9 @@ static int xudc_probe(struct platform_device *pdev) udc->dma_enabled ? "with DMA" : "without DMA"); return 0; + +err_disable_unprepare_clk: + clk_disable_unprepare(udc->clk); fail: dev_err(&pdev->dev, "probe failed, %d\n", ret); return ret; -- 2.30.2