[Qemu-devel] [RFC PATCH 4/5] avoid dandling pointers

2011-07-20 Thread Frediano Ziglio

Signed-off-by: Frediano Ziglio 
---
 block/qcow.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/block/qcow.c b/block/qcow.c
index 8ccd7d7..007fb57 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -616,6 +616,7 @@ static int qcow_co_readv(BlockDriverState *bs, int64_t 
sector_num,
 if (acb.qiov->niov > 1) {
 qemu_iovec_from_buffer(acb.qiov, acb.orig_buf, acb.qiov->size);
 qemu_vfree(acb.orig_buf);
+acb.orig_buf = NULL;
 }
 
 return ret;
@@ -700,6 +701,7 @@ static int qcow_co_writev(BlockDriverState *bs, int64_t 
sector_num,
 
 if (acb.qiov->niov > 1) {
 qemu_vfree(acb.orig_buf);
+acb.orig_buf = NULL;
 }
 
 return ret;
-- 
1.7.1




[Qemu-devel] [RFC PATCH 4/5] avoid dandling pointers

2011-07-20 Thread Frediano Ziglio

Signed-off-by: Frediano Ziglio 
---
 block/qcow.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/block/qcow.c b/block/qcow.c
index 8ccd7d7..007fb57 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -616,6 +616,7 @@ static int qcow_co_readv(BlockDriverState *bs, int64_t 
sector_num,
 if (acb.qiov->niov > 1) {
 qemu_iovec_from_buffer(acb.qiov, acb.orig_buf, acb.qiov->size);
 qemu_vfree(acb.orig_buf);
+acb.orig_buf = NULL;
 }
 
 return ret;
@@ -700,6 +701,7 @@ static int qcow_co_writev(BlockDriverState *bs, int64_t 
sector_num,
 
 if (acb.qiov->niov > 1) {
 qemu_vfree(acb.orig_buf);
+acb.orig_buf = NULL;
 }
 
 return ret;
-- 
1.7.1




Re: [Qemu-devel] [RFC PATCH 4/5] avoid dandling pointers

2011-07-21 Thread Kevin Wolf
Am 20.07.2011 15:56, schrieb Frediano Ziglio:
> Signed-off-by: Frediano Ziglio 
> ---
>  block/qcow.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

Subject needs a "qcow: ..."

Kevin



Re: [Qemu-devel] [RFC PATCH 4/5] avoid dandling pointers

2011-07-22 Thread Frediano Ziglio
2011/7/22 Kevin Wolf :
> Am 20.07.2011 15:56, schrieb Frediano Ziglio:
>> Signed-off-by: Frediano Ziglio 
>> ---
>>  block/qcow.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> Subject needs a "qcow: ..."
>
> Kevin
>

Yes, now I removed that patch as with argument on stack it just make
few sense...