virtio-scsi: Plug memory leak on virtio_scsi_push_event() error path
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c4ce4c4b1f
commit
91e7fcca47
|
@ -489,7 +489,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
|
||||||
uint32_t event, uint32_t reason)
|
uint32_t event, uint32_t reason)
|
||||||
{
|
{
|
||||||
VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
|
VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
|
||||||
VirtIOSCSIReq *req = virtio_scsi_pop_req(s, vs->event_vq);
|
VirtIOSCSIReq *req;
|
||||||
VirtIOSCSIEvent *evt;
|
VirtIOSCSIEvent *evt;
|
||||||
VirtIODevice *vdev = VIRTIO_DEVICE(s);
|
VirtIODevice *vdev = VIRTIO_DEVICE(s);
|
||||||
int in_size;
|
int in_size;
|
||||||
|
@ -498,6 +498,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req = virtio_scsi_pop_req(s, vs->event_vq);
|
||||||
if (!req) {
|
if (!req) {
|
||||||
s->events_dropped = true;
|
s->events_dropped = true;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue