Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c80ad6d1 authored by Kevin Hilman's avatar Kevin Hilman Committed by Greg Kroah-Hartman
Browse files

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: default avatarKevin Hilman <khilman@linaro.org>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarTomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 14e1d2df
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1161,11 +1161,13 @@ void ohci_init_driver(struct hc_driver *drv,
	/* Copy the generic table to drv and then apply the overrides */
	*drv = ohci_hc_driver;

	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);

/*-------------------------------------------------------------------------*/