scsi: virtio_scsi: fix handling of kmalloc failure
authorZheng Wang <zyytlz.wz@163.com>
Thu, 2 Feb 2023 06:41:24 +0000 (14:41 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 21 Feb 2023 00:26:59 +0000 (19:26 -0500)
commit08707b5c3344864d8948cb67706bad489b86773d
treed259e1bab5cdf5334475f08ab0ecd4d49682b558
parent699209fcc55cb97ede9ee8c2160095e0f5dfc73c
scsi: virtio_scsi: fix handling of kmalloc failure

There is no check about the return value of kmalloc in
virtscsi_rescan_hotunplug. Add the check to avoid use
of null pointer 'inq_result' in case of the failure
of kmalloc.

Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Message-Id: <20230202064124.22277-1-zyytlz.wz@163.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/scsi/virtio_scsi.c