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 E383925F780; Mon, 22 Sep 2025 19:36:39 +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=1758569800; cv=none; b=oYGF2lRIhtl7h0vU6y8rTt3Uz1ZSYI+Dc/31WRdWMvmeQVdyrPAKJGME8HLu6MKsTBnEJkWNm+yMr/CsySD3zT1BZF+6MvfEaoF6CkLRKzRoxuBSYNXaUMG3sBciy30LB9gCR9K1TrtHbhgKJAuQcuksA1a1SmfkmCQbaPD6MjY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758569800; c=relaxed/simple; bh=36l8AVcY24J8Y1IjAeYzi4fF9gw/wIhx9fuSVXzmXuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A9IJa1gPIZ+llNbtE3i+Z3/f+i5qajQWSRpHXoaZt92I7oMGcKk+vNpQitNBc4kD6ZrSb2ddcb3LH1GooJjCvgJlxTxsrcj5lrqyekYVi9ypDO7d67j0fF4QRsFtqCOhf6gcH3p/FkLHXQdJZHKO9KUj0l3UHkSm6jtDGdf74kY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wbVfgiRh; 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="wbVfgiRh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78BCDC4CEF0; Mon, 22 Sep 2025 19:36:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758569799; bh=36l8AVcY24J8Y1IjAeYzi4fF9gw/wIhx9fuSVXzmXuw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wbVfgiRh1DM4G0XmqTasADvO001AxD14cveBq28BVUd246/26dAKnMlIuUMIFNa5a JWxx0aXEjjsL68mEzEtGucYwQ/aD58VIkatkbZHNr1Pfz/fT1xZX7qESOlafnPqF0y RmO/orStexNHVLao4oYZvWMxqBCCZkr56oo++www= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Roger Quadros , Johan Hovold , Vinod Koul , Sasha Levin Subject: [PATCH 6.6 61/70] phy: ti: omap-usb2: fix device leak at unbind Date: Mon, 22 Sep 2025 21:30:01 +0200 Message-ID: <20250922192406.238666578@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250922192404.455120315@linuxfoundation.org> References: <20250922192404.455120315@linuxfoundation.org> User-Agent: quilt/0.68 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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold [ Upstream commit 64961557efa1b98f375c0579779e7eeda1a02c42 ] Make sure to drop the reference to the control device taken by of_find_device_by_node() during probe when the driver is unbound. Fixes: 478b6c7436c2 ("usb: phy: omap-usb2: Don't use omap_get_control_dev()") Cc: stable@vger.kernel.org # 3.13 Cc: Roger Quadros Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20250724131206.2211-3-johan@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/phy/ti/phy-omap-usb2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/drivers/phy/ti/phy-omap-usb2.c +++ b/drivers/phy/ti/phy-omap-usb2.c @@ -363,6 +363,13 @@ static void omap_usb2_init_errata(struct phy->flags |= OMAP_USB2_DISABLE_CHRG_DET; } +static void omap_usb2_put_device(void *_dev) +{ + struct device *dev = _dev; + + put_device(dev); +} + static int omap_usb2_probe(struct platform_device *pdev) { struct omap_usb *phy; @@ -373,6 +380,7 @@ static int omap_usb2_probe(struct platfo struct device_node *control_node; struct platform_device *control_pdev; const struct usb_phy_data *phy_data; + int ret; phy_data = device_get_match_data(&pdev->dev); if (!phy_data) @@ -423,6 +431,11 @@ static int omap_usb2_probe(struct platfo return -EINVAL; } phy->control_dev = &control_pdev->dev; + + ret = devm_add_action_or_reset(&pdev->dev, omap_usb2_put_device, + phy->control_dev); + if (ret) + return ret; } else { if (of_property_read_u32_index(node, "syscon-phy-power", 1,