提交 1017f6af 编写于 作者: I Ingo Molnar 提交者: Linus Torvalds

[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: NIngo Molnar <mingo@elte.hu>
Cc: Jim Cromie <jim.cromie@gmail.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 491d525f
......@@ -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;
}
......
......@@ -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); */
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册