]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4b494db3103ba3fa0c7c2aacfcd8957b3266d1f4
tree1efb67713bbe6aa8f2dd48367e5166256a7f5523
parent800c74db7d22dbf84c60e3481e5a2fabad3573b4
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