[bug report] accel/ivpu: Add GEM buffer object management

Dan Carpenter dan.carpenter at linaro.org
Mon Aug 19 18:58:57 UTC 2024


Hello Jacek Lawrynowicz,

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

Commit 647371a6609d ("accel/ivpu: Add GEM buffer object management")
from Jan 17, 2023, leads to the following Smatch complaint:

    ./drivers/accel/ivpu/ivpu_drv.c:119 ivpu_file_priv_put()
    warn: variable dereferenced before check 'file_priv' (see line 117)

./drivers/accel/ivpu/ivpu_drv.c
   116		struct ivpu_file_priv *file_priv = *link;
   117		struct ivpu_device *vdev = file_priv->vdev;
                                           ^^^^^^^^^^^^^^^
Dereference

   118	
   119		drm_WARN_ON(&vdev->drm, !file_priv);
                                         ^^^^^^^^^
Pointless check.  If there is a NULL dereference it already prints a stack
trace.  Also it's really unlikely that we're going to predict which pointer is
going to lead to a NULL dereference ahead of time.

   120	
   121		ivpu_dbg(vdev, KREF, "file_priv put: ctx %u refcount %u\n",

regards,
dan carpenter


More information about the dri-devel mailing list