Skip to content

Commit

Permalink
firewire: fix small memory leak at module removal
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
  • Loading branch information
Stefan Richter committed Jan 4, 2009
1 parent 621f6dd commit d6053e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firewire/fw-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions drivers/firewire/fw-device.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/idr.h>
#include <linux/rwsem.h>
#include <asm/atomic.h>

Expand Down Expand Up @@ -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;

/*
Expand Down
2 changes: 2 additions & 0 deletions drivers/firewire/fw-transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <linux/completion.h>
#include <linux/idr.h>
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/module.h>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d6053e0

Please sign in to comment.