提交 c80ad6d1 编写于 作者: K Kevin Hilman 提交者: Greg Kroah-Hartman

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: NKevin Hilman <khilman@linaro.org>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NTomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 14e1d2df
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册