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: 103004 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2177755vqr; Sun, 4 Jun 2023 07:57:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GhoKdXZVW4fre1/9lj7vYJiB03NknINwTy9O2zPnt6e2RseIlo3moTsEmt+9OsUY70mnY X-Received: by 2002:a05:6a20:12d6:b0:10c:2c30:4765 with SMTP id v22-20020a056a2012d600b0010c2c304765mr4514033pzg.1.1685890654055; Sun, 04 Jun 2023 07:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685890654; cv=none; d=google.com; s=arc-20160816; b=IBNiXVZjlKl/dU0fZ4fbP0LuECLJRe8QRuMm7PX9JoHgOjhX7ILtLFL5e/NA3Sgem5 0hbIwwLHQXFCfbqsbiQaDwCODCXni/5iEuYsKq97ZFuN5bS1eOt1xocxczakwZxAIyPl pabblz+/3waqDOQHleyLM0nWc38T+LkgJ2Ez8Qjr63HeWxPiPcAgutaQSUl9er6mHjTF y41Pn8jXiqrQg6y6lzQlNAnKMmSniS3F49dmXw/bP2ISzrOz5AIaZF0Sq75FS+Xii4PG fo67B0aLVQCOKjgPVGdE0uvxyZ14MuWz917HWnUBzLVtzrMY4jIIlDZ96YHQF4EUeR3e pQYw== 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:dkim-signature; bh=yUaA6iuQ+wEq2pR0TTwubVvItnjACHFQxAMGLNFZLXc=; b=OPy8fULsZXbBJp7ZGjMX6SN2G6Za5cAmV1X6Ku0GTZUx6glCTBlNMAQ+ILh2fSQbw5 3kBjkId+NV+aFlqJf1JZV4tsHBRbzVfb4KmrB2QDPJhm5zdxAZp+PQzch1PjCSif7Ost 0PDsf/aFJPn1B4eDMkoXj3wXq23IEYC41KbkyR1kyIH4HILRrSj5PqYI9CU+sGDOmIZM T0buKQpFLjPRvDh6wgWyq0AYOz9X9W2AC6+8SqjVyDKWKZjfQgs9bSS3NfyQosMG0pzG UYD+jdWFFHEcIgbCg/E2DQkSz0Cf0UG5QGKNRcX7SFKDM9U1cnDMazyKCbEAa5kxs//y BbeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=mMHiVsx0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k64-20020a633d43000000b005347efdfecbsi4274299pga.111.2023.06.04.07.57.18; Sun, 04 Jun 2023 07:57:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=mMHiVsx0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231989AbjFDO4n (ORCPT + 99 others); Sun, 4 Jun 2023 10:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231909AbjFDO4m (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 E2B77CD 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767784478519188634?= X-GMAIL-MSGID: =?utf-8?q?1767784478519188634?= 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; } } }