Re: [Qemu-devel] [PATCH] PCI: add param check for api

2016-01-12 Thread Paolo Bonzini
On 12/01/2016 08:22, Cao jin wrote: > Thanks for your time. I almost forget this one... > > On 01/11/2016 05:20 PM, Paolo Bonzini wrote: >> >> >> On 11/01/2016 09:32, Michael Tokarev wrote: > > +assert(size > 0); > +assert(offset >= PCI_CONFIG_HEADER_SIZE || !offset); > +

Re: [Qemu-devel] [PATCH] PCI: add param check for api

2016-01-11 Thread Cao jin
Thanks for your time. I almost forget this one... On 01/11/2016 05:20 PM, Paolo Bonzini wrote: On 11/01/2016 09:32, Michael Tokarev wrote: +assert(size > 0); +assert(offset >= PCI_CONFIG_HEADER_SIZE || !offset); + I'd like to see some ACKs/Reviews for this one, in particular why siz

Re: [Qemu-devel] [PATCH] PCI: add param check for api

2016-01-11 Thread Cao jin
On 01/11/2016 04:32 PM, Michael Tokarev wrote: 21.11.2015 10:45, Cao jin wrote: add param check for pci_add_capability2, as it is a public API. Signed-off-by: Cao jin --- hw/pci/pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 168b9cc..6938f64

Re: [Qemu-devel] [PATCH] PCI: add param check for api

2016-01-11 Thread Paolo Bonzini
On 11/01/2016 09:32, Michael Tokarev wrote: >> > >> > +assert(size > 0); >> > +assert(offset >= PCI_CONFIG_HEADER_SIZE || !offset); >> > + > I'd like to see some ACKs/Reviews for this one, in particular why > size should be != 0. In fact it should be >= 2, because two bytes are always

Re: [Qemu-devel] [PATCH] PCI: add param check for api

2016-01-11 Thread Michael Tokarev
21.11.2015 10:45, Cao jin wrote: > add param check for pci_add_capability2, as it is a public API. > > Signed-off-by: Cao jin > --- > hw/pci/pci.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > index 168b9cc..6938f64 100644 > --- a/hw/pci/pci.c > +++ b

[Qemu-devel] [PATCH] PCI: add param check for api

2015-11-20 Thread Cao jin
add param check for pci_add_capability2, as it is a public API. Signed-off-by: Cao jin --- hw/pci/pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 168b9cc..6938f64 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2144,6 +2144,9 @@ int pci_add_capabil