Re: [Qemu-devel] [PATCH v2 3/6] pci: Fix the wrong return value judgment condition

2017-06-05 Thread Mao Zhongyi
Hi, Marcel On 06/06/2017 12:20 AM, Marcel Apfelbaum wrote: On 02/06/2017 10:54, Mao Zhongyi wrote: On success, pci_add_capability2() returns a positive value. On failure, it sets an error and return a negative value. It doesn't always return 0. So the judgment condtion of pci_add_capability2()

Re: [Qemu-devel] [PATCH v2 3/6] pci: Fix the wrong return value judgment condition

2017-06-05 Thread Marcel Apfelbaum
On 02/06/2017 10:54, Mao Zhongyi wrote: On success, pci_add_capability2() returns a positive value. On failure, it sets an error and return a negative value. It doesn't always return 0. So the judgment condtion of pci_add_capability2() is wrong if it contains the situation where return value equa

[Qemu-devel] [PATCH v2 3/6] pci: Fix the wrong return value judgment condition

2017-06-02 Thread Mao Zhongyi
On success, pci_add_capability2() returns a positive value. On failure, it sets an error and return a negative value. It doesn't always return 0. So the judgment condtion of pci_add_capability2() is wrong if it contains the situation where return value equal to 0. Fix the error checks from its call