In the case of packed, use indirect desc, since desc is allocated by kmalloc_array(), we should check whether its return value is NULL. This patch alloc desc inside virtqueue_add_packe(), if desc == NULL, fall back to not using indirect. v3: Update commit message of the #1 patch. v2: Separate the style fix into a single patch. Xuan Zhuo (2): virtio_ring: fix style of virtqueue_add_indirect_packed virtio_ring: check desc == NULL when packed and indirect drivers/virtio/virtio_ring.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) -- 2.31.0 _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization