qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Stefan Weil <sw@weilnetz.de>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1.1] kvm: Fix wrong size in memset
Date: Wed, 16 May 2012 07:55:20 +0200	[thread overview]
Message-ID: <4FB34148.7000100@suse.de> (raw)
In-Reply-To: <1337147593-20587-1-git-send-email-sw@weilnetz.de>

Am 16.05.2012 07:53, schrieb Stefan Weil:
> Only the first 4 or 8 bytes were set to 0.
> This bug was found by cppcheck.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

This was already posted by Jim.

/-F

> ---
>  hw/kvm/apic.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/kvm/apic.c b/hw/kvm/apic.c
> index ffe7a52..a0ab503 100644
> --- a/hw/kvm/apic.c
> +++ b/hw/kvm/apic.c
> @@ -29,7 +29,7 @@ void kvm_put_apic_state(DeviceState *d, struct kvm_lapic_state *kapic)
>      APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);
>      int i;
>  
> -    memset(kapic, 0, sizeof(kapic));
> +    memset(kapic, 0, sizeof(*kapic));
>      kvm_apic_set_reg(kapic, 0x2, s->id << 24);
>      kvm_apic_set_reg(kapic, 0x8, s->tpr);
>      kvm_apic_set_reg(kapic, 0xd, s->log_dest << 24);

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

      reply	other threads:[~2012-05-16  5:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16  5:53 [Qemu-devel] [PATCH 1.1] kvm: Fix wrong size in memset Stefan Weil
2012-05-16  5:55 ` Andreas Färber [this message]

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=4FB34148.7000100@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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).