Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-20 Thread Paolo Bonzini
On 20/11/2014 09:24, Jason Wang wrote: > On 11/20/2014 04:18 PM, Gonglei wrote: >> On 2014/11/20 16:11, Jason Wang wrote: >> >>> On 11/20/2014 04:05 PM, Gonglei wrote: On 2014/11/20 15:50, Jason Wang wrote: >>> Maybe just initialize iov unconditionally at the beginning and check >>>

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-20 Thread Gonglei
On 2014/11/20 16:24, Jason Wang wrote: > On 11/20/2014 04:18 PM, Gonglei wrote: >> On 2014/11/20 16:11, Jason Wang wrote: >> >>> On 11/20/2014 04:05 PM, Gonglei wrote: On 2014/11/20 15:50, Jason Wang wrote: >>> Maybe just initialize iov unconditionally at the beginning and check

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-20 Thread Jason Wang
On 11/20/2014 04:18 PM, Gonglei wrote: > On 2014/11/20 16:11, Jason Wang wrote: > >> On 11/20/2014 04:05 PM, Gonglei wrote: >>> On 2014/11/20 15:50, Jason Wang wrote: >>> >> Maybe just initialize iov unconditionally at the beginning and check dot1q_buf instead of iov for the rest of th

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-20 Thread Gonglei
On 2014/11/20 16:11, Jason Wang wrote: > On 11/20/2014 04:05 PM, Gonglei wrote: >> On 2014/11/20 15:50, Jason Wang wrote: >> > Maybe just initialize iov unconditionally at the beginning and check >>> dot1q_buf instead of iov for the rest of the functions. (Need deal with >>> size < ETH

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-20 Thread Jason Wang
On 11/20/2014 04:05 PM, Gonglei wrote: > On 2014/11/20 15:50, Jason Wang wrote: > Maybe just initialize iov unconditionally at the beginning and check >> dot1q_buf instead of iov for the rest of the functions. (Need deal with >> size < ETHER_ADDR_LEN * 2) More complicated, because

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-20 Thread Gonglei
On 2014/11/20 15:50, Jason Wang wrote: >>> Maybe just initialize iov unconditionally at the beginning and check >>> >> dot1q_buf instead of iov for the rest of the functions. (Need deal with >>> >> size < ETHER_ADDR_LEN * 2) >> > More complicated, because we can't initialize iov when >> > "size <

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-19 Thread Jason Wang
On 11/20/2014 03:12 PM, Gonglei wrote: > On 2014/11/20 14:55, Jason Wang wrote: > >> On 11/20/2014 02:29 PM, Paolo Bonzini wrote: >>> On 20/11/2014 06:57, arei.gong...@huawei.com wrote: From: Gonglei Coverity spot: Assigning: iov = struct iovec [3]({{buf, 12UL},

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-19 Thread Gonglei
On 2014/11/20 14:55, Jason Wang wrote: > On 11/20/2014 02:29 PM, Paolo Bonzini wrote: >> >> On 20/11/2014 06:57, arei.gong...@huawei.com wrote: >>> From: Gonglei >>> >>> Coverity spot: >>> Assigning: iov = struct iovec [3]({{buf, 12UL}, >>>{(void *)dot1q_buf, 4UL}, >>>

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-19 Thread Jason Wang
On 11/20/2014 02:29 PM, Paolo Bonzini wrote: > > On 20/11/2014 06:57, arei.gong...@huawei.com wrote: >> From: Gonglei >> >> Coverity spot: >> Assigning: iov = struct iovec [3]({{buf, 12UL}, >>{(void *)dot1q_buf, 4UL}, >>{buf + 12, size - 12}}) >> (

Re: [Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-19 Thread Paolo Bonzini
On 20/11/2014 06:57, arei.gong...@huawei.com wrote: > From: Gonglei > > Coverity spot: > Assigning: iov = struct iovec [3]({{buf, 12UL}, >{(void *)dot1q_buf, 4UL}, >{buf + 12, size - 12}}) > (address of temporary variable of type struct iovec [3

[Qemu-devel] [PATCH 4/4] rtl8139: fix Pointer to local outside scope

2014-11-19 Thread arei.gonglei
From: Gonglei Coverity spot: Assigning: iov = struct iovec [3]({{buf, 12UL}, {(void *)dot1q_buf, 4UL}, {buf + 12, size - 12}}) (address of temporary variable of type struct iovec [3]). out_of_scope: Temporary variable of type struct iovec [3] goes