aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/octeon-usb
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2013-06-04 02:46:21 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-05 15:25:42 -0700
commit5e15430eaf0168d32df6d0dcacabdbab0448fb67 (patch)
treecc27021151f99b160c3dfd977a3d49357149a2d6 /drivers/staging/octeon-usb
parent55fa328aecb1daf9134278b0eb660502627bf60e (diff)
staging: octeon-usb: call device_unregister when platform_device_register_simple fails
device_register is called before platform_device_register_simple gets called. unregister and reset the octeon_usb_registered variable Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: David Daney <ddaney.cavm@gmail.com> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/octeon-usb')
-rw-r--r--drivers/staging/octeon-usb/octeon-hcd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index f3a096be2aba..fa72d59e3aa0 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -785,6 +785,8 @@ static int __init octeon_usb_module_init(void)
pdev = platform_device_register_simple((char*)octeon_usb_driver.name, device, &irq_resource, 1);
if (IS_ERR(pdev)) {
DEBUG_FATAL("OcteonUSB: Failed to allocate platform device for USB%d\n", device);
+ driver_unregister(&octeon_usb_driver);
+ octeon_usb_registered = 0;
return PTR_ERR(pdev);
}
if (device < MAX_USB_PORTS)

Privacy Policy