qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, arei.gonglei@huawei.com
Cc: luonengjun@huawei.com, weidong.huang@huawei.com,
	qemu-devel@nongnu.org, stefanha@redhat.com, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out
Date: Fri, 13 Jun 2014 09:47:36 +0200	[thread overview]
Message-ID: <539AAC98.8010902@redhat.com> (raw)
In-Reply-To: <87vbs5s2kc.fsf@blackfin.pond.sub.org>

Il 13/06/2014 09:15, Markus Armbruster ha scritto:
> I'm afraid this is not an improvement.
>
> Your patch makes the code ignore fclose() failure silently.  This is a
> common mistake.  fclose() failure after write can mean data loss, and
> the user certainly needs to know about that.

If you want that, the best solution is to first fflush() and then 
fclose().  Then you're sure that the fclose() doesn't cause data loss 
and you can safely ignore its result (it shouldn't fail).

Paolo

  parent reply	other threads:[~2014-06-13  7:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13  1:46 [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out arei.gonglei
2014-06-13  7:15 ` Markus Armbruster
2014-06-13  7:23   ` Peter Maydell
2014-06-13  7:47   ` Paolo Bonzini [this message]
2014-06-13  7:59     ` Gerd Hoffmann
2014-06-13  8:18       ` Paolo Bonzini
2014-06-13  8:32         ` Gonglei (Arei)

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=539AAC98.8010902@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=luonengjun@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=weidong.huang@huawei.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).