vhost_vdpa: don't setup irq offloading when irq_num < 0
authorZhu Lingshan <lingshan.zhu@intel.com>
Tue, 22 Feb 2022 11:54:25 +0000 (19:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 May 2022 07:57:25 +0000 (09:57 +0200)
commit87c54a0b64752c09f4e4e13e4959d66495fba227
treee95318eed2d3cd3ab7e1708bd51d28970971ea4e
parent4e32c4c7016eeb2186ffa4ebcbadbddc4b071234
vhost_vdpa: don't setup irq offloading when irq_num < 0

[ Upstream commit cce0ab2b2a39072d81f98017f7b076f3410ef740 ]

When irq number is negative(e.g., -EINVAL), the virtqueue
may be disabled or the virtqueues are sharing a device irq.
In such case, we should not setup irq offloading for a virtqueue.

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Link: https://lore.kernel.org/r/20220222115428.998334-3-lingshan.zhu@intel.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vhost/vdpa.c