usb: gadget: atmel_usba: fix crashed during stopping when DEBUG is enabled
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Mon, 3 Mar 2014 16:48:34 +0000 (17:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 May 2014 14:59:30 +0000 (07:59 -0700)
commitf2ae820563a9d76626c09a05e5887490a96cb3c2
tree3013d67b9d8606c7cbbe0ae878c1e48e72d79ed1
parentc269953543992a67cc7dc47bbf892d77d49d6060
usb: gadget: atmel_usba: fix crashed during stopping when DEBUG is enabled

commit d8eb6c653ef6b323d630de3c5685478469e248bc upstream.

commit 511f3c5 (usb: gadget: udc-core: fix a regression during gadget driver
unbinding) introduced a crash when DEBUG is enabled.

The debug trace in the atmel_usba_stop function made the assumption that the
driver pointer passed in parameter was not NULL, but since the commit above,
such assumption was no longer always true.

This commit now uses the driver pointer stored in udc which fixes this
issue.

[ balbi@ti.com : improved commit log a bit ]

Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/atmel_usba_udc.c