summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-hcd.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2013-09-27 08:10:32 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-30 18:58:42 -0700
commitc80ad6d1cd6c6662d0cff752d94a1a9fde6de4ac (patch)
tree9822525d9d78008b674300247a5e3ea3d2026259 /drivers/usb/host/ohci-hcd.c
parent14e1d2dfe73f48bbc267b9ef0a9d5a62685f5861 (diff)
downloadtalos-obmc-linux-c80ad6d1cd6c6662d0cff752d94a1a9fde6de4ac.tar.gz
talos-obmc-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.c10
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);
OpenPOWER on IntegriCloud