android_kernel_motorola_sm6375/drivers/virtio
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Murilo Opsfelder Araujo 13fbdea118 virtio-pci: Remove wrong address verification in vp_del_vqs()
commit 7e415282b41bf0d15c6e0fe268f822d9b083f2f7 upstream.

GCC 12 enhanced -Waddress when comparing array address to null [0],
which warns:

    drivers/virtio/virtio_pci_common.c: In function ‘vp_del_vqs’:
    drivers/virtio/virtio_pci_common.c:257:29: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘vp_dev->msix_affinity_masks + (sizetype)((long unsigned int)i * 256)’ must not be NULL [-Waddress]
      257 |                         if (vp_dev->msix_affinity_masks[i])
          |                             ^~~~~~

In fact, the verification is comparing the result of a pointer
arithmetic, the address "msix_affinity_masks + i", which will always
evaluate to true.

Under the hood, free_cpumask_var() calls kfree(), which is safe to pass
NULL, not requiring non-null verification.  So remove the verification
to make compiler happy (happy compiler, happy life).

[0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102103

Signed-off-by: Murilo Opsfelder Araujo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Christophe de Dinechin <[email protected]>
Cc: Sudip Mukherjee <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-22 14:11:24 +02:00
..
Kconfig
Makefile
virtio.c virtio: acknowledge all features before access 2022-03-16 13:21:48 +01:00
virtio_balloon.c
virtio_input.c
virtio_mmio.c virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed 2022-06-22 14:11:21 +02:00
virtio_pci_common.c virtio-pci: Remove wrong address verification in vp_del_vqs() 2022-06-22 14:11:24 +02:00
virtio_pci_common.h
virtio_pci_legacy.c
virtio_pci_modern.c
virtio_ring.c virtio_ring: Fix querying of maximum DMA mapping size for virtio device 2021-12-22 09:29:34 +01:00