diff mbox

curl: qemu_bh_new() can never return NULL

Message ID 1377517130-12343-1-git-send-email-stefanha@redhat.com
State New
Headers show

Commit Message

Stefan Hajnoczi Aug. 26, 2013, 11:38 a.m. UTC
Drop error code path which cannot be taken since qemu_bh_new() does not
return NULL.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/curl.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Paolo Bonzini Aug. 26, 2013, 1:48 p.m. UTC | #1
Il 26/08/2013 13:38, Stefan Hajnoczi ha scritto:
> Drop error code path which cannot be taken since qemu_bh_new() does not
> return NULL.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  block/curl.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/block/curl.c b/block/curl.c
> index e566855..ca2cedc 100644
> --- a/block/curl.c
> +++ b/block/curl.c
> @@ -572,12 +572,6 @@ static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs,
>      acb->nb_sectors = nb_sectors;
>  
>      acb->bh = qemu_bh_new(curl_readv_bh_cb, acb);
> -
> -    if (!acb->bh) {
> -        DPRINTF("CURL: qemu_bh_new failed\n");
> -        return NULL;
> -    }
> -
>      qemu_bh_schedule(acb->bh);
>      return &acb->common;
>  }
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Michael Tokarev Sept. 1, 2013, 3:12 p.m. UTC | #2
26.08.2013 15:38, Stefan Hajnoczi wrote:
> Drop error code path which cannot be taken since qemu_bh_new() does not
> return NULL.

Thanks, applied to the trivial-patches queue.

/mjt
diff mbox

Patch

diff --git a/block/curl.c b/block/curl.c
index e566855..ca2cedc 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -572,12 +572,6 @@  static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs,
     acb->nb_sectors = nb_sectors;
 
     acb->bh = qemu_bh_new(curl_readv_bh_cb, acb);
-
-    if (!acb->bh) {
-        DPRINTF("CURL: qemu_bh_new failed\n");
-        return NULL;
-    }
-
     qemu_bh_schedule(acb->bh);
     return &acb->common;
 }