USB: fsl_qe_udc: Fix oops on QE UDC probe failure
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Thu, 25 Dec 2008 14:15:02 +0000 (17:15 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 Feb 2009 19:19:46 +0000 (11:19 -0800)
commit94f341db3dd080851f918da37e84659ef760da26
tree1efb67713bbe6aa8f2dd48367e5166256a7f5523
parentf06da264cfb0f9444d41ca247213e419f90aa72a
USB: fsl_qe_udc: Fix oops on QE UDC probe failure

In case of probing errors the driver kfrees the udc_controller, but it
doesn't set the pointer to NULL.

When usb_gadget_register_driver is called, it checks for udc_controller
!= NULL, the check passes and the driver accesses nonexistent memory.
Fix this by setting udc_controller to NULL in case of errors.

While at it, also implement irq_of_parse_and_map()'s failure and cleanup
cases.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/fsl_qe_udc.c