Commit d6053e08 authored by Stefan Richter's avatar Stefan Richter

firewire: fix small memory leak at module removal

Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 621f6dd7
...@@ -617,7 +617,7 @@ static int shutdown_unit(struct device *device, void *data) ...@@ -617,7 +617,7 @@ static int shutdown_unit(struct device *device, void *data)
*/ */
DECLARE_RWSEM(fw_device_rwsem); DECLARE_RWSEM(fw_device_rwsem);
static DEFINE_IDR(fw_device_idr); DEFINE_IDR(fw_device_idr);
int fw_cdev_major; int fw_cdev_major;
struct fw_device *fw_device_get_by_devt(dev_t devt) struct fw_device *fw_device_get_by_devt(dev_t devt)
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/cdev.h> #include <linux/cdev.h>
#include <linux/idr.h>
#include <linux/rwsem.h> #include <linux/rwsem.h>
#include <asm/atomic.h> #include <asm/atomic.h>
...@@ -99,6 +100,7 @@ void fw_device_cdev_update(struct fw_device *device); ...@@ -99,6 +100,7 @@ void fw_device_cdev_update(struct fw_device *device);
void fw_device_cdev_remove(struct fw_device *device); void fw_device_cdev_remove(struct fw_device *device);
extern struct rw_semaphore fw_device_rwsem; extern struct rw_semaphore fw_device_rwsem;
extern struct idr fw_device_idr;
extern int fw_cdev_major; extern int fw_cdev_major;
/* /*
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/idr.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/kref.h> #include <linux/kref.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -971,6 +972,7 @@ static void __exit fw_core_cleanup(void) ...@@ -971,6 +972,7 @@ static void __exit fw_core_cleanup(void)
{ {
unregister_chrdev(fw_cdev_major, "firewire"); unregister_chrdev(fw_cdev_major, "firewire");
bus_unregister(&fw_bus_type); bus_unregister(&fw_bus_type);
idr_destroy(&fw_device_idr);
} }
module_init(fw_core_init); module_init(fw_core_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment