diff options
author | Avik Sil <aviksil@linux.vnet.ibm.com> | 2013-02-14 10:54:57 +0530 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-02-14 08:32:02 -0500 |
commit | 7cac600a661bf664553726b0729916f5485a310b (patch) | |
tree | 0e453f9d2de507eb3910d457ab65c99586327240 | |
parent | 58b157f8fa3889272cd68aca31828c719d202b08 (diff) | |
download | seabios-7cac600a661bf664553726b0729916f5485a310b.tar.gz |
USB-EHCI: Fix null pointer assignment
cntl->regs should not be accessed before initializing it.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
-rw-r--r-- | src/usb-ehci.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |