qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-trivial@nongnu.org, kwolf@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] ide: remove undefined behavior in ide-test
Date: Mon, 13 Feb 2017 10:56:15 -0500	[thread overview]
Message-ID: <ae6284d9-6776-6ae4-a041-06819d69d413@redhat.com> (raw)
In-Reply-To: <20170213150003.GO10361@stefanha-x1.localdomain>



On 02/13/2017 10:00 AM, Stefan Hajnoczi wrote:
> On Wed, Feb 08, 2017 at 12:05:33PM -0500, John Snow wrote:
>> trivial: initialize the dirty buffer with a random-ish byte.
>> Stops valgrind from whining about uninitialized buffers.
>>
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> ---
>>  tests/ide-test.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/tests/ide-test.c b/tests/ide-test.c
>> index 2fa97bc..139ebc0 100644
>> --- a/tests/ide-test.c
>> +++ b/tests/ide-test.c
>> @@ -550,6 +550,7 @@ static void make_dirty(uint8_t device)
>>  
>>      guest_buf = guest_alloc(guest_malloc, len);
>>      buf = g_malloc(len);
>> +    memset(buf, rand() % 255 + 1, len);
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> 

Thanks.

This can go in through the next TRIVIAL pull, as my queue is otherwise
empty right now.

>>      g_assert(guest_buf);
>>      g_assert(buf);
> 
> Pre-existing issue:
> g_assert(buf) is unnecessary since g_malloc() is guaranteed to return
> non-NULL.
> 

Yeah, I did see that ...

  reply	other threads:[~2017-02-13 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 17:05 [Qemu-devel] [PATCH] ide: remove undefined behavior in ide-test John Snow
2017-02-13 15:00 ` Stefan Hajnoczi
2017-02-13 15:56   ` John Snow [this message]
2017-02-15 10:18 ` Michael Tokarev

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=ae6284d9-6776-6ae4-a041-06819d69d413@redhat.com \
    --to=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@gmail.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).