e2b98415256cb264bc25e6df539ec0dc9d1b85b0 broke things sometimes:
If pt_find_reg_grp() fails and returns NULL, it will jump to out:,
but at this time reg is still NULL (pt_find_reg() is not reached)
which leads to a NULL dereference.
This patch fixes it.
Submitted-By: Qing He <qing.he@intel.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
val >>= ((address & 3) << 3);
out:
- if (!reg->no_wb) {
+ if (!(reg && reg->no_wb)) { /* unknown regs are passed through */
ret = pci_write_block(pci_dev, address, (uint8_t *)&val, len);
if (!ret)