From nobody Sun Feb 8 13:10:55 2026 Received: from mx.swemel.ru (mx.swemel.ru [95.143.211.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 396692918C1; Tue, 10 Jun 2025 12:27:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.143.211.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749558475; cv=none; b=bHIzeC2qw79UpP23HSYh0Iw0bSCTRsPEP7iVIzBc/11d3luEmv97rtmVi0uWbmnrfqhTnVPZeDjQRsRXI1GQMf+3t5TgUyrN8GeQCkGBiAoBB1uMoQgXcq53+06nronh/JSuibUMvr0j5XHIdpVCsky1c6nDIQ+GqnhldMqeIuw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749558475; c=relaxed/simple; bh=Fgl8Km4RcqFqfY5t3kYoDxE8TNS0WlKWi77RytkhSfQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CnuRRIgnzurCyr/Os8mo9wT6W7EZd75jkhcJxHUy/apuxvUm2oxCAD2zsjWZQrrL52xim4evpIcdk3grwi+wWjaTb2VVrM6T5F+EKh12Mt0cw3kCoCJ2FqqyZvHfQxHO016hKGZvO8SaWByQ2YYyR4S9lQpzDe2TxVDPiB3AiS4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=swemel.ru; spf=pass smtp.mailfrom=swemel.ru; dkim=pass (1024-bit key) header.d=swemel.ru header.i=@swemel.ru header.b=A1U0ge5c; arc=none smtp.client-ip=95.143.211.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=swemel.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=swemel.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=swemel.ru header.i=@swemel.ru header.b="A1U0ge5c" From: Denis Arefev DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=swemel.ru; s=mail; t=1749558468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+Bbt95GEmQZjMfBLT8mqmVirRMgBRSh8XbLFCIcVluk=; b=A1U0ge5cGHWCXef1/O7X6PRMh1IycsE0FrYls3CumAZvkv6CE6op5zROUo50PfT/Sjf3iC EY2cFaSkyb3p4cxNoaS9gGaBYVWqoRcE26N+Zd2GK2jXneEBuVZ5AkEsK/E+h8XO0qeFzz 27yONfEjeP5PYKNbxNkp6G8YJGubTOM= To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Andy Gross , Bjorn Andersson , Felipe Balbi , Lee Jones , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Miaoqian Lin Subject: [PATCH 5.10] usb: dwc3: dwc3-qcom: Add missing platform_device_put() in dwc3_qcom_acpi_register_core Date: Tue, 10 Jun 2025 15:27:46 +0300 Message-ID: <20250610122748.22575-1-arefev@swemel.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin commit fa0ef93868a6062babe1144df2807a8b1d4924d2 upstream. Add the missing platform_device_put() before return from dwc3_qcom_acpi_register_core in the error handling case. Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20211231113641.31474-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman [Denis: minor fix to resolve merge conflict and add tag Fixes.] Signed-off-by: Denis Arefev = =20 --- Backport fix for CVE-2023-22995 Link: https://nvd.nist.gov/vuln/detail/cve-2023-22995 --- drivers/usb/dwc3/dwc3-qcom.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index db3559a10207..568973582b75 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -622,8 +622,10 @@ static int dwc3_qcom_acpi_register_core(struct platfor= m_device *pdev) qcom->dwc3->dev.coherent_dma_mask =3D dev->coherent_dma_mask; =20 child_res =3D kcalloc(2, sizeof(*child_res), GFP_KERNEL); - if (!child_res) + if (!child_res) { + platform_device_put(qcom->dwc3); return -ENOMEM; + } =20 res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { @@ -659,10 +661,15 @@ static int dwc3_qcom_acpi_register_core(struct platfo= rm_device *pdev) } =20 ret =3D platform_device_add(qcom->dwc3); - if (ret) + if (ret) { dev_err(&pdev->dev, "failed to add device\n"); + goto out; + } + kfree(child_res); + return 0; =20 out: + platform_device_put(qcom->dwc3); kfree(child_res); return ret; } --=20 2.43.0