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:
parent
052fbc0d7f
commit
ecf85e481a
1 changed files with 2 additions and 1 deletions
|
@ -43,7 +43,8 @@ EXPORT_SYMBOL(otg_get_transceiver);
|
||||||
*/
|
*/
|
||||||
void otg_put_transceiver(struct otg_transceiver *x)
|
void otg_put_transceiver(struct otg_transceiver *x)
|
||||||
{
|
{
|
||||||
put_device(x->dev);
|
if (x)
|
||||||
|
put_device(x->dev);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(otg_put_transceiver);
|
EXPORT_SYMBOL(otg_put_transceiver);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue