* [ patch -mm1 03/11 ] gpio-patchset-fixups: scx200 init undo malloc
@ 2006-06-22 18:50 Jim Cromie
0 siblings, 0 replies; only message in thread
From: Jim Cromie @ 2006-06-22 18:50 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux kernel
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 <jim.cromie@gmail.com>
diff -ruNp -X dontdiff -X exclude-diffs aa-2/drivers/char/scx200_gpio.c aa-3/drivers/char/scx200_gpio.c
--- aa-2/drivers/char/scx200_gpio.c 2006-06-22 09:43:16.000000000 -0600
+++ aa-3/drivers/char/scx200_gpio.c 2006-06-22 09:30:20.000000000 -0600
@@ -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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-06-22 18:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-22 18:50 [ patch -mm1 03/11 ] gpio-patchset-fixups: scx200 init undo malloc Jim Cromie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.