drm/msm: Fix pointer dereference and use dev->dev
Subsystems (4)
cover drm/msm: Fix pointer dereference and use dev->dev
Fix a potential null pointer dereference issue and replace minor->dev->dev with dev->dev in error messages.
Colin Ian King (2):
Fix dereference of pointer minor before null check drm/msm: replace minor->dev->dev with dev->dev
drivers/gpu/drm/msm/msm_debugfs.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
Signature · 1 line
2.50.0
PATCH 2/2 drm/msm: replace minor->dev->dev with dev->dev
The pointer dev has been set to minor->dev, so replace minor->dev->dev with dev->dev in the DRM_DEV_ERROR messages.
--- drivers/gpu/drm/msm/msm_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_debugfs.c +2 -2
@@ -340,13 +340,13 @@ static int late_init_minor(struct drm_minor *minor) ret =msm_rd_debugfs_init (minor);if (ret) { -DRM_DEV_ERROR (minor->dev->dev,"could not install rd debugfs\n" ); +DRM_DEV_ERROR (dev->dev,"could not install rd debugfs\n" );return ret; } ret =msm_perf_debugfs_init (minor);if (ret) { -DRM_DEV_ERROR (minor->dev->dev,"could not install perf debugfs\n" ); +DRM_DEV_ERROR (dev->dev,"could not install perf debugfs\n" );return ret; }
Signature · 1 line
2.50.0
Re: [PATCH 2/2][next] drm/msm: replace minor->dev->dev with dev->dev
Quoted 5 lines · Colin Ian King
The pointer dev has been set to
minor->dev, so replaceminor->dev->devwithdev->devin theDRM_DEV_ERRORmessages.Signed-off-by Colin Ian King <[email protected]>---
Konrad
PATCH v2 1/2 Fix dereference of pointer minor before null check
In reply to Colin Ian KingCurrently the pointer minor is being dereferenced before it is null checked, leading to a potential null pointer dereference issue. Fix this by dereferencing the pointer only after it has been null checked.
--- drivers/gpu/drm/msm/msm_debugfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_debugfs.c +5 -2
@@ -325,13 +325,16 @@ static struct drm_info_list msm_debugfs_list[] = {static int late_init_minor (struct drm_minor *minor) { -struct drm_device *dev = minor->dev; -struct msm_drm_private *priv = dev->dev_private; +struct drm_device *dev; +struct msm_drm_private *priv;int ret;if (!minor)return 0 ; + dev = minor->dev; + priv = dev->dev_private; +if (!priv->gpu_pdev)return 0 ;
Signature · 4 lines
V2: remove changes of minor->dev->dev to dev->dev, put them in 2nd patch -- 2.50.0
Re: [PATCH 1/2][next][V2] Fix dereference of pointer minor before null check
Quoted 7 lines · Colin Ian King
Currently the pointer minor is being dereferenced before it is null checked, leading to a potential null pointer dereference issue. Fix this by dereferencing the pointer only after it has been null checked.
Fixes 4f89cf40d01e ("drm/msm: bail out late_init_minor() if it is not a GPU device")Signed-off-by Colin Ian King <[email protected]>---
Konrad
Quoted 2 lines
Fix a potential null pointer dereference issue and replace
minor->dev->devwithdev->devin error messages.
Did you accidentally overlook to mark this patch series as a subsequent version?
https://lore.kernel.org/lkml/[email protected]/
Regards,
Markus