From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 14E46313546; Wed, 3 Dec 2025 16:48:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764780480; cv=none; b=BTNNybpRlOn37tED/tQnub914feKkrJnln0mllCKFppIz0X/U8yfEg3w/szdnY1+h5qdjjKr+a2k1CzZjjc/r8pA3aA9Xxi8NVR5vspup8u6PxD2dvLyhQUnosm+XVVLRa3ltXpD6aTW/PWbWZOg/NdhZfSFNcG+ft7jh41L1j4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764780480; c=relaxed/simple; bh=EFXht+Hd/u+0Fs4dmlALixXYc2l4yrep9PpmMd14RLg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a2qbvHQpnsS4OYhpL1K9fYokCW3fcsfgjNyNluW/TliIm07mzBzsfnNeCGZfw/gcs09H/ggPypg18q6HjhXoHeHeZ50kuNs3WE2IXoZRStxzsCNziApgtuLLdS9y20rHjLtMoQ/ZTepTo7B5uEN8r19c9+ckR2fruS5ZnK8oRK0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qSHQwm4M; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qSHQwm4M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAB35C4CEF5; Wed, 3 Dec 2025 16:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764780479; bh=EFXht+Hd/u+0Fs4dmlALixXYc2l4yrep9PpmMd14RLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qSHQwm4MunXzcXP5RrxqUNDFGoaWtrS4vxSCTLiSpDfaBfdiA+lkG7gjdJnLbprpu CodLTu/2BEbVaRl5aTxsL6wT7ye9kIkrOCXth/K5H0905EVUiVMVtWsveRmc6iaR+8 VwDRwMTrPb8QQ6SbO1/e27dfW7oDq3XC/DUWtaf8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Miaoqian Lin , Peter Chen Subject: [PATCH 6.1 536/568] usb: cdns3: Fix double resource release in cdns3_pci_probe Date: Wed, 3 Dec 2025 16:28:58 +0100 Message-ID: <20251203152500.345582409@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152440.645416925@linuxfoundation.org> References: <20251203152440.645416925@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miaoqian Lin commit 1ec39d2cd88dac2e7cdbac248762f1f057971c5d upstream. The driver uses pcim_enable_device() to enable the PCI device, the device will be automatically disabled on driver detach through the managed device framework. The manual pci_disable_device() calls in the error paths are therefore redundant and should be removed. Found via static anlaysis and this is similar to commit 99ca0b57e49f ("thermal: intel: int340x: processor: Fix warning during module unload"). Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Cc: stable Signed-off-by: Miaoqian Lin Acked-by: Peter Chen Link: https://patch.msgid.link/20251026090859.33107-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/cdns3/cdns3-pci-wrap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/usb/cdns3/cdns3-pci-wrap.c +++ b/drivers/usb/cdns3/cdns3-pci-wrap.c @@ -101,10 +101,8 @@ static int cdns3_pci_probe(struct pci_de wrap = pci_get_drvdata(func); } else { wrap = kzalloc(sizeof(*wrap), GFP_KERNEL); - if (!wrap) { - pci_disable_device(pdev); + if (!wrap) return -ENOMEM; - } } res = wrap->dev_res; @@ -163,7 +161,6 @@ static int cdns3_pci_probe(struct pci_de /* register platform device */ wrap->plat_dev = platform_device_register_full(&plat_info); if (IS_ERR(wrap->plat_dev)) { - pci_disable_device(pdev); err = PTR_ERR(wrap->plat_dev); kfree(wrap); return err;