All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] PCI: add param check for api
@ 2015-11-21  7:45 ` Cao jin
  0 siblings, 0 replies; 12+ messages in thread
From: Cao jin @ 2015-11-21  7:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, mst

add param check for pci_add_capability2, as it is a public API.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 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_capability2(PCIDevice *pdev, uint8_t cap_id,
     uint8_t *config;
     int i, overlapping_cap;
 
+    assert(size > 0);
+    assert(offset >= PCI_CONFIG_HEADER_SIZE || !offset);
+
     if (!offset) {
         offset = pci_find_space(pdev, size);
         if (!offset) {
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-01-12 12:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-21  7:45 [Qemu-trivial] [PATCH] PCI: add param check for api Cao jin
2015-11-21  7:45 ` [Qemu-devel] " Cao jin
2016-01-11  8:32 ` [Qemu-trivial] " Michael Tokarev
2016-01-11  8:32   ` [Qemu-devel] " Michael Tokarev
2016-01-11  9:20   ` [Qemu-trivial] " Paolo Bonzini
2016-01-11  9:20     ` [Qemu-devel] " Paolo Bonzini
2016-01-12  7:22     ` [Qemu-trivial] " Cao jin
2016-01-12  7:22       ` [Qemu-devel] " Cao jin
2016-01-12 12:04       ` [Qemu-trivial] " Paolo Bonzini
2016-01-12 12:04         ` [Qemu-devel] " Paolo Bonzini
2016-01-12  6:39   ` [Qemu-trivial] " Cao jin
2016-01-12  6:39     ` [Qemu-devel] " Cao jin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.