The code is not prepared to handle such case, so just return early. In
the debug case add an assert.
Coverity ID:
1430809
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
unsigned int data_offset = 0;
uint32_t data = ~(uint32_t)0;
+ if ( !size )
+ {
+ ASSERT_UNREACHABLE();
+ return data;
+ }
+
/* Find the PCI dev matching the address. */
pdev = pci_get_pdev_by_domain(d, sbdf.seg, sbdf.bus, sbdf.extfunc);
if ( !pdev )
const struct vpci_register *r;
unsigned int data_offset = 0;
+ if ( !size )
+ {
+ ASSERT_UNREACHABLE();
+ return;
+ }
+
/*
* Find the PCI dev matching the address.
* Passthrough everything that's not trapped.