From patchwork Sun Jun 4 14:56:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13266671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B487C77B73 for ; Sun, 4 Jun 2023 14:56:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231791AbjFDO4m (ORCPT ); Sun, 4 Jun 2023 10:56:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231916AbjFDO4m (ORCPT ); Sun, 4 Jun 2023 10:56:42 -0400 Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8F29CA for ; Sun, 4 Jun 2023 07:56:39 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 5p9nqXazR0h9k5p9nqRBSI; Sun, 04 Jun 2023 16:56:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685890597; bh=yUaA6iuQ+wEq2pR0TTwubVvItnjACHFQxAMGLNFZLXc=; h=From:To:Cc:Subject:Date; b=mMHiVsx0L/Wo7j7u0lVmTjpJqxcW22V7qqbr7+xp8MfIeWnrIvcT+whm9RpjuDHJG HdG8VPA7o/RzclfA+4MTBo1zyfWoBcwfB9fkfBoXAHjLmuXokxVRfY0S88LOifaOPO WHkw9VboJnGcypPIkYCKAeSjHi0VRhlotQrF2fdvuilcA826dmrATM8e/wNGdCKlJ8 tY3eZaHiO/DTE+EN4LYMzr3sJjf1kfBk6A/xqdlLBYqng8TRgK+bLxu8CDDL6JVS4O g1qpHslIg5fF6YLg9MTAvdwJt68q4i7PKxKOcVoCLFOFSkCrWLE5K9hfI+dzOkJoMb D6k3cxiftJysw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 04 Jun 2023 16:56:37 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Thinh Nguyen , Greg Kroah-Hartman , Shawn Guo Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH] usb: dwc3: qcom: Fix an error handling path in dwc3_qcom_probe() Date: Sun, 4 Jun 2023 16:56:34 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org If dwc3_qcom_create_urs_usb_platdev() fails, some resources still need to be released, as already done in the other error handling path of the probe. Fixes: c25c210f590e ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot") Signed-off-by: Christophe JAILLET Reviewed-by: Andrew Halaney --- drivers/usb/dwc3/dwc3-qcom.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 822735814050..aa96c473f839 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -856,9 +856,10 @@ static int dwc3_qcom_probe(struct platform_device *pdev) if (IS_ERR_OR_NULL(qcom->urs_usb)) { dev_err(dev, "failed to create URS USB platdev\n"); if (!qcom->urs_usb) - return -ENODEV; + ret = -ENODEV; else - return PTR_ERR(qcom->urs_usb); + ret = PTR_ERR(qcom->urs_usb); + goto clk_disable; } } }