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 ETHER_ADDR_LEN * 2.

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 we can't initialize

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 ETHER_ADDR_LEN * 2) More

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 the functions. (Need deal

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 dot1q_buf instead of iov

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 dot1q_buf instead of iov

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

2014-11-19 Thread arei.gonglei
From: Gonglei arei.gong...@huawei.com 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

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 arei.gong...@huawei.com Coverity spot: Assigning: iov = struct iovec [3]({{buf, 12UL}, {(void *)dot1q_buf, 4UL}, {buf + 12, size - 12}}) (address of temporary variable of

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 arei.gong...@huawei.com Coverity spot: Assigning: iov = struct iovec [3]({{buf, 12UL}, {(void *)dot1q_buf, 4UL}, {buf + 12, size -

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 arei.gong...@huawei.com 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 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 arei.gong...@huawei.com Coverity spot: Assigning: iov = struct iovec [3]({{buf, 12UL},