drm/gem: Check locking in drm_gem_object_unreference

Dan Carpenter dan.carpenter at oracle.com
Fri Oct 16 23:33:50 PDT 2015


Hello Daniel Vetter,

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

The patch 5771551c4877: "drm/gem: Check locking in 
drm_gem_object_unreference" from Oct 15, 2015, leads to the following 
Smatch complaint:

include/drm/drm_gem.h:147 drm_gem_object_unreference()
	 warn: variable dereferenced before check 'obj' (see line 145)

include/drm/drm_gem.h
   144	{
   145		WARN_ON(!mutex_is_locked(&obj->dev->struct_mutex));
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deref.

   146	
   147		if (obj != NULL)

check.

   148			kref_put(&obj->refcount, drm_gem_object_free);
   149	}

regards,
dan carpenter


More information about the dri-devel mailing list