[bug report] drm/virtio: Import prime buffers from other devices as guest blobs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Vivek Kasireddy,

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

Commit ca77f27a2665 ("drm/virtio: Import prime buffers from other
devices as guest blobs") from Nov 25, 2024, leads to the following
Smatch complaint:

    drivers/gpu/drm/virtio/virtgpu_prime.c:194 virtgpu_dma_buf_free_obj()
    warn: variable dereferenced before check 'attach' (see line 192)

drivers/gpu/drm/virtio/virtgpu_prime.c
   191		struct dma_buf_attachment *attach = obj->import_attach;
   192		struct dma_resv *resv = attach->dmabuf->resv;
                                        ^^^^^^^^^^^^^^^
The patch adds an unchecked dereference

   193	
   194		if (attach) {
                    ^^^^^^
The older code assumes attach can be NULL

   195			dma_resv_lock(resv, NULL);
   196	

regards,
dan carpenter




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux