USB: otg: Fix bug on remove path without transceiver
In the case where a gadget driver is removed while no transceiver was found at probe time, a bug in otg_put_transceiver() will trigger. Provide symetric calls for otg_get_transceiver() and otg_put_transceiver(), wherever a transceiver was found or not. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Родитель
052fbc0d7f
Коммит
ecf85e481a
|
@ -43,7 +43,8 @@ EXPORT_SYMBOL(otg_get_transceiver);
|
|||
*/
|
||||
void otg_put_transceiver(struct otg_transceiver *x)
|
||||
{
|
||||
put_device(x->dev);
|
||||
if (x)
|
||||
put_device(x->dev);
|
||||
}
|
||||
EXPORT_SYMBOL(otg_put_transceiver);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче