From c80ad6d1cd6c6662d0cff752d94a1a9fde6de4ac Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Fri, 27 Sep 2013 08:10:32 -0700 Subject: [PATCH] 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 Acked-by: Alan Stern Signed-off-by: Tomasz Figa Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ohci-hcd.c | 10 ++++++---- 1 file 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); -- 2.39.5