diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-12-16 15:37:41 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-12-17 16:11:03 +0100 |
commit | ad7171394f2fe3f9b5fe02f0c62496291a859a92 (patch) | |
tree | fe0487891f82d023bb3cdc12dba037a48ad2424d /hw | |
parent | 15654a6d7c3269e922b92f9596e48078c9bfcbfa (diff) | |
download | qemu-ad7171394f2fe3f9b5fe02f0c62496291a859a92.tar.gz qemu-ad7171394f2fe3f9b5fe02f0c62496291a859a92.tar.bz2 qemu-ad7171394f2fe3f9b5fe02f0c62496291a859a92.zip |
Remove NULL checks for bdrv_new return value
It's an indirect call to qemu_malloc, which never returns an error.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xen_disk.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/hw/xen_disk.c b/hw/xen_disk.c index 85a1c85524..ed9e5eb4d7 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -634,17 +634,12 @@ static int blk_init(struct XenDevice *xendev) if (!blkdev->dinfo) { /* setup via xenbus -> create new block driver instance */ xen_be_printf(&blkdev->xendev, 2, "create new bdrv (xenbus setup)\n"); - blkdev->bs = bdrv_new(blkdev->dev); - if (blkdev->bs) { - if (bdrv_open(blkdev->bs, blkdev->filename, qflags, - bdrv_find_whitelisted_format(blkdev->fileproto)) - != 0) { - bdrv_delete(blkdev->bs); - blkdev->bs = NULL; - } - } - if (!blkdev->bs) - return -1; + blkdev->bs = bdrv_new(blkdev->dev); + if (bdrv_open(blkdev->bs, blkdev->filename, qflags, + bdrv_find_whitelisted_format(blkdev->fileproto)) != 0) { + bdrv_delete(blkdev->bs); + return -1; + } } else { /* setup via qemu cmdline -> already setup for us */ xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n"); |