gpio-patchset-fixups: scx200 init undo malloc
Subsystems (2)
Jim Cromie
maintainerPATCH 3/11 gpio-patchset-fixups: scx200 init undo malloc
If platform_device_add() fails, the add doesnt need to be undone. What is needed it to undo the previous malloc.
Signed-off-by Jim Cromie <[email protected]>
drivers/char/scx200_gpio.c +0 -0
@@ -91,7 +91,7 @@ static int __init scx200_gpio_init(void)
rc = platform_device_add(pdev); if (rc)
- goto undo_platform_device_add;
+ goto undo_malloc;
/* nsc_gpio uses dev_dbg(), so needs this */ scx200_access.dev = &pdev->dev; @@ -127,7 +127,8 @@ undo_chrdev_region: unregister_chrdev_region(dev, num_pins); undo_platform_device_add: platform_device_put(pdev); - kfree(pdev); /* undo platform_device_alloc */ +undo_malloc: + kfree(pdev); return rc; }