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 8FF3E2F260C; Wed, 17 Sep 2025 12:45:59 +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=1758113159; cv=none; b=SEQ1NaDmhMQ/31F8fOGRrijw9WFk4+nsVqvuyipDophDlVW36X2Lh3FceQYRkNXlWwZQj8mgvYpcV1Tb/j215clP5qbv2jwsp8MeSIxyYcMKotObX4gImrfD2Ue1zfNGhgmKDNlx3jZxHCpFc7V+SgHfU1Cz3HCu49PZ1FAAJ3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758113159; c=relaxed/simple; bh=maWDZroGC5uVami4+hFMGzx3u9dFtbFsBVxLe8+G83Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bq2Ob5ccw72WYYSmpnfWySQHfsLCqiw2QFpg3AlEwUth0lnDUjk7WnYXAG3X/QCmW4JzSMGWLGLKZn+hnum3oJeVXKmE2Cw0mGrQpXa9yu+Tl5KrVuHdC+XTPm66jCpiASYk8v7CWezaSXDyRDoi29KYLt4G5jwiO2NnqyjJRiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cUHLl4Oj; 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="cUHLl4Oj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11C6AC4CEF0; Wed, 17 Sep 2025 12:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758113159; bh=maWDZroGC5uVami4+hFMGzx3u9dFtbFsBVxLe8+G83Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cUHLl4OjP19MNKNUyQ/6Qy3P8vq0NgsIzlFypyIEMWTxs0x0K4Zqv9TWIog7aXTpl iT98tvfvvCA0UPLjW8zqMQCH80aQLefRme7ZUCepkW1yPrElG0t1H4w+2mvg/0ZlfP sPajpI/5ARi8DG7wECNRvEKzCXH4MQgKLkbfYl7I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Roger Quadros , Johan Hovold , Vinod Koul Subject: [PATCH 6.16 189/189] phy: ti-pipe3: fix device leak at unbind Date: Wed, 17 Sep 2025 14:34:59 +0200 Message-ID: <20250917123356.511776611@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250917123351.839989757@linuxfoundation.org> References: <20250917123351.839989757@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit e19bcea99749ce8e8f1d359f68ae03210694ad56 upstream. 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: 918ee0d21ba4 ("usb: phy: omap-usb3: 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-4-johan@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/phy/ti/phy-ti-pipe3.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/drivers/phy/ti/phy-ti-pipe3.c +++ b/drivers/phy/ti/phy-ti-pipe3.c @@ -667,12 +667,20 @@ static int ti_pipe3_get_clk(struct ti_pi return 0; } +static void ti_pipe3_put_device(void *_dev) +{ + struct device *dev = _dev; + + put_device(dev); +} + static int ti_pipe3_get_sysctrl(struct ti_pipe3 *phy) { struct device *dev = phy->dev; struct device_node *node = dev->of_node; struct device_node *control_node; struct platform_device *control_pdev; + int ret; phy->phy_power_syscon = syscon_regmap_lookup_by_phandle(node, "syscon-phy-power"); @@ -704,6 +712,11 @@ static int ti_pipe3_get_sysctrl(struct t } phy->control_dev = &control_pdev->dev; + + ret = devm_add_action_or_reset(dev, ti_pipe3_put_device, + phy->control_dev); + if (ret) + return ret; } if (phy->mode == PIPE3_MODE_PCIE) {