fsl_usb2_udc: Fix oops on probe failure.
authorWill Newton <will.newton@gmail.com>
Tue, 12 Aug 2008 14:39:17 +0000 (15:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 17 Oct 2008 21:41:07 +0000 (14:41 -0700)
commit23d7cd040e1f43113da3e8763becf576ab86b39a
treed4f98257a6a379dfcf53d814aef79cdebe1cd340
parent59097fb73cf60276053551308524f6c772f305a9
fsl_usb2_udc: Fix oops on probe failure.

In some circumstances when fsl_udc_probe fails udc_controller is freed but
the pointer remains non-NULL. fsl_udc_remove will then try and teardown
the partly initialized and freed controller structure resulting in an oops.
This patch ensures udc_controller is either NULL or fully initialized after
fsl_udc_probe.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/fsl_usb2_udc.c