diff options
author | Kevin Hilman <khilman@linaro.org> | 2013-09-27 17:10:32 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-01 03:58:42 +0200 |
commit | c80ad6d1cd6c6662d0cff752d94a1a9fde6de4ac (patch) | |
tree | 9822525d9d78008b674300247a5e3ea3d2026259 /drivers/usb/host/ohci-hcd.c | |
parent | usb: wusbcore: clean up urb dequeue process (diff) | |
download | linux-c80ad6d1cd6c6662d0cff752d94a1a9fde6de4ac.tar.xz linux-c80ad6d1cd6c6662d0cff752d94a1a9fde6de4ac.zip |
USB: OHCI: ohci_init_driver(): sanity check overrides
Check for non-NULL overrides before dereferencing since platforms may
pass in NULL overrides.
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ohci-hcd.c')
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 21d937a590e8..8ada13f8dde2 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1161,10 +1161,12 @@ void ohci_init_driver(struct hc_driver *drv, /* Copy the generic table to drv and then apply the overrides */ *drv = ohci_hc_driver; - drv->product_desc = over->product_desc; - drv->hcd_priv_size += over->extra_priv_size; - if (over->reset) - drv->reset = over->reset; + if (over) { + drv->product_desc = over->product_desc; + drv->hcd_priv_size += over->extra_priv_size; + if (over->reset) + drv->reset = over->reset; + } } EXPORT_SYMBOL_GPL(ohci_init_driver); |