xen_disk: fix possible null-ptr dereference
authorGonglei (Arei) <arei.gonglei@huawei.com>
Mon, 28 Jul 2014 06:03:45 +0000 (06:03 +0000)
committerKevin Wolf <kwolf@redhat.com>
Fri, 15 Aug 2014 13:07:13 +0000 (15:07 +0200)
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/block/xen_disk.c

index aed5b5b3e93f8c03a817ed7abf8204b03e096b37..a221d0bfca7fc18c2d0c215af9d627a6ac6247f4 100644 (file)
@@ -589,6 +589,7 @@ static int blk_send_response_one(struct ioreq *ioreq)
         break;
     default:
         dst = NULL;
+        return 0;
     }
     memcpy(dst, &resp, sizeof(resp));
     blkdev->rings.common.rsp_prod_pvt++;