cntl->regs should not be accessed before initializing it.
Signed-off-by: Avik Sil aviksil@linux.vnet.ibm.com --- src/usb-ehci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/usb-ehci.c b/src/usb-ehci.c index f28f343..69a9194 100644 --- a/src/usb-ehci.c +++ b/src/usb-ehci.c @@ -347,9 +347,9 @@ ehci_setup(struct pci_device *pci, int busid, struct pci_device *comppci) cntl->usb.pci = pci; cntl->usb.type = USB_TYPE_EHCI; cntl->caps = caps; + cntl->regs = (void*)caps + readb(&caps->caplength); if (hcc_params & HCC_64BIT_ADDR) cntl->regs->ctrldssegment = 0; - cntl->regs = (void*)caps + readb(&caps->caplength);
dprintf(1, "EHCI init on dev %02x:%02x.%x (regs=%p)\n" , pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf)
On Thu, Feb 14, 2013 at 10:54:57AM +0530, Avik Sil wrote:
cntl->regs should not be accessed before initializing it.
Thanks. I committed your patch.
-Kevin