From: Stefan Richter Date: Mon, 24 Nov 2008 19:40:00 +0000 (+0100) Subject: firewire: fix small memory leak at module removal X-Git-Tag: v2.6.29-rc1~187^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d6053e08f5520dcb58c200d2e1861d9c505b72e8;p=linux-2.6-omap-h63xx.git firewire: fix small memory leak at module removal Signed-off-by: Stefan Richter --- diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c index 6b9be42c7b9..31b6c74d34d 100644 --- a/drivers/firewire/fw-device.c +++ b/drivers/firewire/fw-device.c @@ -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) diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h index 42305bbac72..df51732608d 100644 --- a/drivers/firewire/fw-device.h +++ b/drivers/firewire/fw-device.h @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -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; /* diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c index 2884f876397..699ac041f39 100644 --- a/drivers/firewire/fw-transaction.c +++ b/drivers/firewire/fw-transaction.c @@ -19,6 +19,7 @@ */ #include +#include #include #include #include @@ -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);