qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>, qemu-devel@nongnu.org
Cc: stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] curl: Don't deref NULL pointer in call to aio_poll.
Date: Wed, 27 Aug 2014 23:43:21 +0200	[thread overview]
Message-ID: <53FE50F9.1090600@redhat.com> (raw)
In-Reply-To: <1409160687-32212-2-git-send-email-rjones@redhat.com>

Il 27/08/2014 19:31, Richard W.M. Jones ha scritto:
> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
> ---
>  block/curl.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/block/curl.c b/block/curl.c
> index 46f1082..8b69f28 100644
> --- a/block/curl.c
> +++ b/block/curl.c
> @@ -355,7 +355,7 @@ static void curl_multi_timeout_do(void *arg)
>  #endif
>  }
>  
> -static CURLState *curl_init_state(BDRVCURLState *s)
> +static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s)
>  {
>      CURLState *state = NULL;
>      int i, j;
> @@ -373,7 +373,7 @@ static CURLState *curl_init_state(BDRVCURLState *s)
>              break;
>          }
>          if (!state) {
> -            aio_poll(state->s->aio_context, true);
> +            aio_poll(bdrv_get_aio_context(bs), true);
>          }
>      } while(!state);
>  
> @@ -552,7 +552,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
>      DPRINTF("CURL: Opening %s\n", file);
>      s->aio_context = bdrv_get_aio_context(bs);
>      s->url = g_strdup(file);
> -    state = curl_init_state(s);
> +    state = curl_init_state(bs, s);
>      if (!state)
>          goto out_noclean;
>  
> @@ -636,7 +636,7 @@ static void curl_readv_bh_cb(void *p)
>      }
>  
>      // No cache found, so let's start a new request
> -    state = curl_init_state(s);
> +    state = curl_init_state(acb->common.bs, s);
>      if (!state) {
>          acb->common.cb(acb->common.opaque, -EIO);
>          qemu_aio_release(acb);
> 

This looks good, thanks.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

  reply	other threads:[~2014-08-27 21:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 17:31 [Qemu-devel] [PATCH] curl: Don't deref NULL pointer in call to aio_poll Richard W.M. Jones
2014-08-27 17:31 ` Richard W.M. Jones
2014-08-27 21:43   ` Paolo Bonzini [this message]
2014-08-28  0:18   ` Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53FE50F9.1090600@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).