Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out

2014-06-13 Thread Gonglei (Arei)
: [Qemu-devel] [PATCH] audio: Fix using freed pointer in > wav_fini_out > > Il 13/06/2014 09:59, Gerd Hoffmann ha scritto: > > On Fr, 2014-06-13 at 09:47 +0200, Paolo Bonzini wrote: > >> Il 13/06/2014 09:15, Markus Armbruster ha scritto: > >>> I'm afraid thi

Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out

2014-06-13 Thread Paolo Bonzini
Il 13/06/2014 09:59, Gerd Hoffmann ha scritto: On Fr, 2014-06-13 at 09:47 +0200, Paolo Bonzini wrote: 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() failu

Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out

2014-06-13 Thread Gerd Hoffmann
On Fr, 2014-06-13 at 09:47 +0200, Paolo Bonzini wrote: > 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,

Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out

2014-06-13 Thread Paolo Bonzini
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,

Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out

2014-06-13 Thread Peter Maydell
On 13 June 2014 08:15, Markus Armbruster wrote: > writes: > >> From: Gonglei >> >> Spotted by Coverity: >> >> (8) Event freed_arg: "fclose(FILE *)" frees "wav->f". >> (9) Event cond_true: Condition "fclose(wav->f)", taking true branch >> Also see events: [pass_freed_arg] >> >> 212 if

Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out

2014-06-13 Thread Markus Armbruster
writes: > From: Gonglei > > Spotted by Coverity: > > (8) Event freed_arg: "fclose(FILE *)" frees "wav->f". > (9) Event cond_true: Condition "fclose(wav->f)", taking true branch > Also see events: [pass_freed_arg] > > 212 if (fclose (wav->f)) { > (10) Event pass_freed_arg: Passing fr

[Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out

2014-06-12 Thread arei.gonglei
From: Gonglei Spotted by Coverity: (8) Event freed_arg: "fclose(FILE *)" frees "wav->f". (9) Event cond_true: Condition "fclose(wav->f)", taking true branch Also see events: [pass_freed_arg] 212 if (fclose (wav->f)) { (10) Event pass_freed_arg: Passing freed pointer "wav->f" as an