]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
ecd33a0ac06b57fb28d8e25258b63cbdd131c86a
[thirdparty/kernel/stable-queue.git] /
1 From git-commits-head-owner@vger.kernel.org Thu Apr 20 09:02:58 2006
2 Date: Thu, 20 Apr 2006 16:00:56 GMT
3 Message-Id: <200604201600.k3KG0uk0002856@hera.kernel.org>
4 From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
5 To: git-commits-head@vger.kernel.org
6 Subject: [PATCH] cs5535_gpio.c: call cdev_del() during module_exit to unmap kobject references and other cleanups
7
8 From: Thayumanavar Sachithanantham <thayumk@gmail.com>
9
10 [PATCH] cs5535_gpio.c: call cdev_del() during module_exit to unmap kobject references and other cleanups
11
12 During module unloading, cdev_del() must be called to unmap cdev related
13 kobject references and other cleanups(such as inode->i_cdev being set to
14 NULL) which prevents the OOPS upon subsequent loading, usage and unloading
15 of modules(as seen in the mail thread
16 http://marc.theaimsgroup.com/?l=linux-kernel&m=114533640609018&w=2).
17
18 Also, remove unneeded test of gpio_base.
19
20 Signed-off-by: Thayumanavar Sachithanantham <thayumk@gmail.com>
21 Signed-off-by: Andrew Morton <akpm@osdl.org>
22 Signed-off-by: Linus Torvalds <torvalds@osdl.org>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
24
25 ---
26 drivers/char/cs5535_gpio.c | 5 +++--
27 1 file changed, 3 insertions(+), 2 deletions(-)
28
29 --- linux-2.6.16.11.orig/drivers/char/cs5535_gpio.c
30 +++ linux-2.6.16.11/drivers/char/cs5535_gpio.c
31 @@ -241,9 +241,10 @@ static int __init cs5535_gpio_init(void)
32 static void __exit cs5535_gpio_cleanup(void)
33 {
34 dev_t dev_id = MKDEV(major, 0);
35 +
36 + cdev_del(&cs5535_gpio_cdev);
37 unregister_chrdev_region(dev_id, CS5535_GPIO_COUNT);
38 - if (gpio_base != 0)
39 - release_region(gpio_base, CS5535_GPIO_SIZE);
40 + release_region(gpio_base, CS5535_GPIO_SIZE);
41 }
42
43 module_init(cs5535_gpio_init);