virtio_ring: check desc == NULL when using indirect with packed
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Wed, 20 Oct 2021 11:23:23 +0000 (19:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:58 +0000 (19:16 +0100)
commit0099c7affb21818e3823669fcc5c96bccb0aa8ec
tree664b258c5c404105d6d61ccb45f6ea7a3656e3d7
parentbcf29e436895e46cf2b6939a403f92957505afe7
virtio_ring: check desc == NULL when using indirect with packed

[ Upstream commit fc6d70f40b3d0b3219e2026d05be0409695f620d ]

When using indirect with packed, we don't check for allocation failures.
This patch checks that and fall back on direct.

Fixes: 1ce9e6055fa0 ("virtio_ring: introduce packed ring support")
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Link: https://lore.kernel.org/r/20211020112323.67466-3-xuanzhuo@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/virtio/virtio_ring.c