* [intel-lts:4.19/android_s 4156/30000] drivers/gpu/drm/virtio/virtgpu_vq.c:750 virtio_gpu_cmd_get_edids() error: 'cmd_p' dereferencing possible ERR_PTR()
@ 2024-09-22 12:28 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-09-22 12:28 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
tree: https://github.com/intel/linux-intel-lts.git 4.19/android_s
head: 84d5fc421289417e51781e27e64fbb0fc44216ae
commit: d4f5248ba0ac929a5d79faf185766987fac4a73b [4156/30000] UPSTREAM: drm/virtio: add edid support
:::::: branch date: 3 weeks ago
:::::: commit date: 5 years ago
config: i386-randconfig-141-20240913 (https://download.01.org/0day-ci/archive/20240922/202409222012.3X1WV06O-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202409222012.3X1WV06O-lkp@intel.com/
New smatch warnings:
drivers/gpu/drm/virtio/virtgpu_vq.c:750 virtio_gpu_cmd_get_edids() error: 'cmd_p' dereferencing possible ERR_PTR()
Old smatch warnings:
drivers/gpu/drm/virtio/virtgpu_vq.c:381 virtio_gpu_cmd_create_resource() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:400 virtio_gpu_cmd_unref_resource() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:416 virtio_gpu_cmd_resource_inval_backing() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:433 virtio_gpu_cmd_set_scanout() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:455 virtio_gpu_cmd_resource_flush() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:484 virtio_gpu_cmd_transfer_to_host_2d() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:508 virtio_gpu_cmd_resource_attach_backing() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:646 virtio_gpu_cmd_get_display_info() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:668 virtio_gpu_cmd_get_capset_info() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:721 virtio_gpu_cmd_get_capset() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:767 virtio_gpu_cmd_context_create() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:784 virtio_gpu_cmd_context_destroy() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:799 virtio_gpu_cmd_context_attach_resource() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:816 virtio_gpu_cmd_context_detach_resource() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:834 virtio_gpu_cmd_resource_create_3d() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:861 virtio_gpu_cmd_transfer_to_host_3d() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:883 virtio_gpu_cmd_transfer_from_host_3d() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:906 virtio_gpu_cmd_submit() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:934 virtio_gpu_object_attach() error: we previously assumed 'obj->pages' could be null (see line 925)
vim +/cmd_p +750 drivers/gpu/drm/virtio/virtgpu_vq.c
62fb7a5e10962a Gerd Hoffmann 2014-10-28 729
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 730 int virtio_gpu_cmd_get_edids(struct virtio_gpu_device *vgdev)
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 731 {
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 732 struct virtio_gpu_cmd_get_edid *cmd_p;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 733 struct virtio_gpu_vbuffer *vbuf;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 734 void *resp_buf;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 735 int scanout;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 736
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 737 if (WARN_ON(!vgdev->has_edid))
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 738 return -EINVAL;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 739
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 740 for (scanout = 0; scanout < vgdev->num_scanouts; scanout++) {
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 741 resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_edid),
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 742 GFP_KERNEL);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 743 if (!resp_buf)
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 744 return -ENOMEM;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 745
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 746 cmd_p = virtio_gpu_alloc_cmd_resp
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 747 (vgdev, &virtio_gpu_cmd_get_edid_cb, &vbuf,
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 748 sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_edid),
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 749 resp_buf);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 @750 cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_EDID);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 751 cmd_p->scanout = cpu_to_le32(scanout);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 752 virtio_gpu_queue_ctrl_buffer(vgdev, vbuf);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 753 }
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 754
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 755 return 0;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 756 }
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 757
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* [intel-lts:4.19/android_s 4156/30000] drivers/gpu/drm/virtio/virtgpu_vq.c:750 virtio_gpu_cmd_get_edids() error: 'cmd_p' dereferencing possible ERR_PTR()
@ 2024-09-25 8:17 Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2024-09-25 8:17 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, oe-kbuild-all
tree: https://github.com/intel/linux-intel-lts.git 4.19/android_s
head: 84d5fc421289417e51781e27e64fbb0fc44216ae
commit: d4f5248ba0ac929a5d79faf185766987fac4a73b [4156/30000] UPSTREAM: drm/virtio: add edid support
config: i386-randconfig-141-20240913 (https://download.01.org/0day-ci/archive/20240922/202409222012.3X1WV06O-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202409222012.3X1WV06O-lkp@intel.com/
New smatch warnings:
drivers/gpu/drm/virtio/virtgpu_vq.c:750 virtio_gpu_cmd_get_edids() error: 'cmd_p' dereferencing possible ERR_PTR()
Old smatch warnings:
drivers/gpu/drm/virtio/virtgpu_vq.c:381 virtio_gpu_cmd_create_resource() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:400 virtio_gpu_cmd_unref_resource() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:416 virtio_gpu_cmd_resource_inval_backing() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:433 virtio_gpu_cmd_set_scanout() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:455 virtio_gpu_cmd_resource_flush() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:484 virtio_gpu_cmd_transfer_to_host_2d() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:508 virtio_gpu_cmd_resource_attach_backing() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:646 virtio_gpu_cmd_get_display_info() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:668 virtio_gpu_cmd_get_capset_info() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:721 virtio_gpu_cmd_get_capset() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:767 virtio_gpu_cmd_context_create() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:784 virtio_gpu_cmd_context_destroy() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:799 virtio_gpu_cmd_context_attach_resource() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:816 virtio_gpu_cmd_context_detach_resource() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:834 virtio_gpu_cmd_resource_create_3d() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:861 virtio_gpu_cmd_transfer_to_host_3d() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:883 virtio_gpu_cmd_transfer_from_host_3d() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:906 virtio_gpu_cmd_submit() error: 'cmd_p' dereferencing possible ERR_PTR()
drivers/gpu/drm/virtio/virtgpu_vq.c:934 virtio_gpu_object_attach() error: we previously assumed 'obj->pages' could be null (see line 925)
vim +/cmd_p +750 drivers/gpu/drm/virtio/virtgpu_vq.c
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 730 int virtio_gpu_cmd_get_edids(struct virtio_gpu_device *vgdev)
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 731 {
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 732 struct virtio_gpu_cmd_get_edid *cmd_p;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 733 struct virtio_gpu_vbuffer *vbuf;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 734 void *resp_buf;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 735 int scanout;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 736
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 737 if (WARN_ON(!vgdev->has_edid))
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 738 return -EINVAL;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 739
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 740 for (scanout = 0; scanout < vgdev->num_scanouts; scanout++) {
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 741 resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_edid),
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 742 GFP_KERNEL);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 743 if (!resp_buf)
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 744 return -ENOMEM;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 745
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 746 cmd_p = virtio_gpu_alloc_cmd_resp
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 747 (vgdev, &virtio_gpu_cmd_get_edid_cb, &vbuf,
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 748 sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_edid),
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 749 resp_buf);
No error checking
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 @750 cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_EDID);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 751 cmd_p->scanout = cpu_to_le32(scanout);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 752 virtio_gpu_queue_ctrl_buffer(vgdev, vbuf);
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 753 }
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 754
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 755 return 0;
d4f5248ba0ac92 Gerd Hoffmann 2018-10-30 756 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-25 8:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 12:28 [intel-lts:4.19/android_s 4156/30000] drivers/gpu/drm/virtio/virtgpu_vq.c:750 virtio_gpu_cmd_get_edids() error: 'cmd_p' dereferencing possible ERR_PTR() kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2024-09-25 8:17 Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.