Files
linux/drivers/gpu/drm/msm
Christophe JAILLET a94fdd4b56 drm/msm/dsi: Fix some reference counted resource leaks
[ Upstream commit 6977cc89c8 ]

'of_find_device_by_node()' takes a reference that must be released when
not needed anymore.
This is expected to be done in 'dsi_destroy()'.

However, there are 2 issues in 'dsi_get_phy()'.

First, if 'of_find_device_by_node()' succeeds but 'platform_get_drvdata()'
returns NULL, 'msm_dsi->phy_dev' will still be NULL, and the reference
won't be released in 'dsi_destroy()'.

Secondly, as 'of_find_device_by_node()' already takes a reference, there is
no need for an additional 'get_device()'.

Move the assignment to 'msm_dsi->phy_dev' a few lines above and remove the
unneeded 'get_device()' to solve both issues.

Fixes: ec31abf668 ("drm/msm/dsi: Separate PHY to another platform device")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f15bc57648a00e7c99f943903468a04639d50596.1628241097.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-22 11:47:53 +02:00
..
2021-04-28 13:16:49 +02:00
2018-08-10 18:49:18 -04:00
2018-08-10 18:49:18 -04:00
2019-12-13 08:52:44 +01:00
2018-03-19 06:33:35 -04:00
2020-01-09 10:19:03 +01:00
2018-12-21 14:15:19 +01:00
2018-07-26 10:45:04 -04:00
2014-01-09 14:44:06 -05:00