[PATCH] fix memory leak in sd_mod.o

From: Dan Aloni
Date: Sun Oct 30 2005 - 12:04:45 EST


Handle freeing of sd_max_sectors in sd_exit().

Signed-off-by: Dan Aloni <da-x@xxxxxxxxxxxxx>

---
commit 94e91dcc1b0903a45642fcb906d8a26c996db277
tree b1d1b44ab4738268f839c83e5e56832124d4b2f3
parent 2afb6d8ea04e81a1547e8e51b7550a8fd69b9fce
author Dan Aloni <da-x@xxxxxxxxxxxxx> Sun, 30 Oct 2005 18:56:35 +0200
committer Dan Aloni <da-x@xxxxxxxxxxxxx> Sun, 30 Oct 2005 18:56:35 +0200

drivers/scsi/sd.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1472,6 +1472,7 @@ static void __exit exit_sd(void)
kfree(sd_sizes);
kfree(sd_blocksizes);
kfree(sd_hardsizes);
+ kfree(sd_max_sectors);
for (i = 0; i < N_USED_SD_MAJORS; i++) {
kfree(sd_gendisks[i].de_arr);
kfree(sd_gendisks[i].flags);
@@ -1482,6 +1483,7 @@ static void __exit exit_sd(void)
del_gendisk(&sd_gendisks[i]);
blksize_size[SD_MAJOR(i)] = NULL;
hardsect_size[SD_MAJOR(i)] = NULL;
+ max_sectors[SD_MAJOR(i)] = NULL;
read_ahead[SD_MAJOR(i)] = 0;
}
sd_template.dev_max = 0;




--
Dan Aloni
da-x@xxxxxxxxxxxxx, da-x@xxxxxxxxxxx, da-x@xxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/