]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
phy: rockchip: samsung-hdptx: Set drvdata before enabling runtime PM
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Wed, 23 Oct 2024 17:29:54 +0000 (20:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jan 2025 09:34:13 +0000 (10:34 +0100)
commit7061849a4a1752a06944a819dd1f7bfd58df7383
tree78bc4547927b126c8caa361893aeff44d7f1ccf2
parente4e6217cf7a62741e73de379148ab5aa279aed6c
phy: rockchip: samsung-hdptx: Set drvdata before enabling runtime PM

commit 9d23e48654620fdccfcc74cc2cef04eaf7353d07 upstream.

In some cases, rk_hdptx_phy_runtime_resume() may be invoked before
platform_set_drvdata() is executed in ->probe(), leading to a NULL
pointer dereference when using the return of dev_get_drvdata().

Ensure platform_set_drvdata() is called before devm_pm_runtime_enable().

Reported-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Fixes: 553be2830c5f ("phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20241023-phy-sam-hdptx-rpm-fix-v1-1-87f4c994e346@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c