[bug report] drm/msm: bail out late_init_minor() if it is not a GPU device

Dan Carpenter dan.carpenter at linaro.org
Tue Jul 15 22:59:13 UTC 2025


Hello Dmitry Baryshkov,

This is a semi-automatic email about new static checker warnings.

Commit 4f89cf40d01e ("drm/msm: bail out late_init_minor() if it is
not a GPU device") from Jul 5, 2025, leads to the following Smatch
complaint:

    drivers/gpu/drm/msm/msm_debugfs.c:332 late_init_minor()
    warn: variable dereferenced before check 'minor' (see line 328)

drivers/gpu/drm/msm/msm_debugfs.c
   327	{
   328		struct drm_device *dev = minor->dev;
                                         ^^^^^^^
The patch adds a dereference

   329		struct msm_drm_private *priv = dev->dev_private;
   330		int ret;
   331	
   332		if (!minor)
                    ^^^^^^
But the older code assumes the minor can be NULL

   333			return 0;
   334	

regards,
dan carpenter


More information about the dri-devel mailing list