Skip to contentSkip to conversation

fix memory leak in sd_mod.o

PATCH New Dan Aloni 1 participant 1 message Oct 30, 2005 SCSI

lore
Share & tools
lore

Dan Aloni

author
#0 lore raw

PATCH 1/1 fix memory leak in sd_mod.o

Handle freeing of sd_max_sectors in sd_exit().

---
commit 94e91dcc1b0903a45642fcb906d8a26c996db277
tree b1d1b44ab4738268f839c83e5e56832124d4b2f3
parent 2afb6d8ea04e81a1547e8e51b7550a8fd69b9fce
author Dan Aloni <[email protected]> Sun, 30 Oct 2005 18:56:35 +0200 committer Dan Aloni <[email protected]> Sun, 30 Oct 2005 18:56:35 +0200

 drivers/scsi/sd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/sd.c +2 -0
@@ -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;
Signature · 2 lines
Dan Aloni
[email protected], [email protected], [email protected]