linux-stable/drivers/virtio
Murilo Opsfelder Araujo 7e415282b4 virtio-pci: Remove wrong address verification in vp_del_vqs()
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 <muriloo@linux.ibm.com>
Message-Id: <20220415023002.49805-1-muriloo@linux.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Christophe de Dinechin <dinechin@redhat.com>
2022-05-31 12:45:08 -04:00
..
Kconfig drivers/virtio: Enable virtio mem for ARM64 2022-03-28 16:52:57 -04:00
Makefile
virtio.c Revert "virtio: use virtio_device_ready() in virtio_device_restore()" 2022-03-30 04:18:14 -04:00
virtio_balloon.c
virtio_dma_buf.c
virtio_input.c
virtio_mem.c drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. 2022-05-13 07:20:13 -07:00
virtio_mmio.c
virtio_pci_common.c virtio-pci: Remove wrong address verification in vp_del_vqs() 2022-05-31 12:45:08 -04:00
virtio_pci_common.h Revert "virtio_pci: harden MSI-X interrupts" 2022-03-28 16:52:59 -04:00
virtio_pci_legacy.c Revert "virtio_pci: harden MSI-X interrupts" 2022-03-28 16:52:59 -04:00
virtio_pci_legacy_dev.c virtio/virtio_pci_legacy_dev: ensure the correct return value 2022-01-14 18:50:53 -05:00
virtio_pci_modern.c virtio: pci: check bar values read from virtio config space 2022-03-28 16:52:59 -04:00
virtio_pci_modern_dev.c virtio: pci: Fix an error handling path in vp_modern_probe() 2022-05-31 12:45:08 -04:00
virtio_ring.c virtio_ring: add unlikely annotation for free descs check 2022-05-31 12:44:25 -04:00
virtio_vdpa.c virtio-vdpa: don't set callback if virtio doesn't need it 2022-05-31 12:44:26 -04:00