accel/ivpu: Add GEM buffer object management
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
Thanks. I agree this check makes no sense. I will remove it.
Quoted 28 lines · Dan Carpenter
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:119ivpu_file_priv_put()
warn: variable dereferenced before check 'file_priv' (see line 117)
./drivers/accel/ivpu/ivpu_drv.c116 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