From: Ingo Molnar Date: Fri, 30 Jun 2006 08:55:29 +0000 (-0700) Subject: [PATCH] fix platform_device_put/del mishaps X-Git-Tag: v2.6.18-rc1~318 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1017f6afd578fe519d316d7148356703c04e8f03;p=linux-2.6 [PATCH] fix platform_device_put/del mishaps This fixes drivers/char/pc8736x_gpio.c and drivers/char/scx200_gpio.c to use the platform_device_del/put ops correctly. Signed-off-by: Ingo Molnar Cc: Jim Cromie Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c index 1c706ccfdb..c860de6a6f 100644 --- a/drivers/char/pc8736x_gpio.c +++ b/drivers/char/pc8736x_gpio.c @@ -319,9 +319,10 @@ static int __init pc8736x_gpio_init(void) return 0; undo_platform_dev_add: - platform_device_put(pdev); + platform_device_del(pdev); undo_platform_dev_alloc: - kfree(pdev); + platform_device_put(pdev); + return rc; } diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c index 5a280a3304..45083e5dd2 100644 --- a/drivers/char/scx200_gpio.c +++ b/drivers/char/scx200_gpio.c @@ -126,9 +126,10 @@ static int __init scx200_gpio_init(void) undo_chrdev_region: unregister_chrdev_region(dev, num_pins); undo_platform_device_add: - platform_device_put(pdev); + platform_device_del(pdev); undo_malloc: - kfree(pdev); + platform_device_put(pdev); + return rc; } @@ -136,7 +137,6 @@ static void __exit scx200_gpio_cleanup(void) { kfree(scx200_devices); unregister_chrdev_region(MKDEV(major, 0), num_pins); - platform_device_put(pdev); platform_device_unregister(pdev); /* kfree(pdev); */ }