]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
firewire: fix small memory leak at module removal
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Mon, 24 Nov 2008 19:40:00 +0000 (20:40 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 4 Jan 2009 22:50:37 +0000 (23:50 +0100)
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/fw-device.c
drivers/firewire/fw-device.h
drivers/firewire/fw-transaction.c

index 6b9be42c7b98f4ef8c99a1806f2b81ed8021885a..31b6c74d34df277bd71c9be80eafe69b9a5e4cc4 100644 (file)
@@ -617,7 +617,7 @@ static int shutdown_unit(struct device *device, void *data)
  */
 DECLARE_RWSEM(fw_device_rwsem);
 
-static DEFINE_IDR(fw_device_idr);
+DEFINE_IDR(fw_device_idr);
 int fw_cdev_major;
 
 struct fw_device *fw_device_get_by_devt(dev_t devt)
index 42305bbac72fb3237c5826c7b6671bc64b6cc931..df51732608d96270a86611c541aaec8cdb7a2150 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <linux/fs.h>
 #include <linux/cdev.h>
+#include <linux/idr.h>
 #include <linux/rwsem.h>
 #include <asm/atomic.h>
 
@@ -99,6 +100,7 @@ void fw_device_cdev_update(struct fw_device *device);
 void fw_device_cdev_remove(struct fw_device *device);
 
 extern struct rw_semaphore fw_device_rwsem;
+extern struct idr fw_device_idr;
 extern int fw_cdev_major;
 
 /*
index 2884f876397b872085925353997276e24e6c4a83..699ac041f39ac576fa7a12ffd2fdf45ff7fe1a48 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <linux/completion.h>
+#include <linux/idr.h>
 #include <linux/kernel.h>
 #include <linux/kref.h>
 #include <linux/module.h>
@@ -971,6 +972,7 @@ static void __exit fw_core_cleanup(void)
 {
        unregister_chrdev(fw_cdev_major, "firewire");
        bus_unregister(&fw_bus_type);
+       idr_destroy(&fw_device_idr);
 }
 
 module_init(fw_core_init);