aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-hcd.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2013-09-27 11:10:32 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-30 21:58:42 -0400
commitc80ad6d1cd6c6662d0cff752d94a1a9fde6de4ac (patch)
tree9822525d9d78008b674300247a5e3ea3d2026259 /drivers/usb/host/ohci-hcd.c
parent14e1d2dfe73f48bbc267b9ef0a9d5a62685f5861 (diff)
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,
1161 /* Copy the generic table to drv and then apply the overrides */ 1161 /* Copy the generic table to drv and then apply the overrides */
1162 *drv = ohci_hc_driver; 1162 *drv = ohci_hc_driver;
1163 1163
1164 drv->product_desc = over->product_desc; 1164 if (over) {
1165 drv->hcd_priv_size += over->extra_priv_size; 1165 drv->product_desc = over->product_desc;
1166 if (over->reset) 1166 drv->hcd_priv_size += over->extra_priv_size;
1167 drv->reset = over->reset; 1167 if (over->reset)
1168 drv->reset = over->reset;
1169 }
1168} 1170}
1169EXPORT_SYMBOL_GPL(ohci_init_driver); 1171EXPORT_SYMBOL_GPL(ohci_init_driver);
1170 1172