* Two small things around sd_init() in 2.4.18-pre4
@ 2002-01-22 5:48 Pete Zaitcev
0 siblings, 0 replies; only message in thread
From: Pete Zaitcev @ 2002-01-22 5:48 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-scsi, zaitcev
Guys & gals:
Recenly, Marcelo took my bugfix for ->init() failure recovery.
When I worked on it, I noticed two small unrelated thinkos which
I'd like someone to verify.
1. It seems that sd_gendisks[i].de_arr and sd_gendisks[i].flags
are never freed, thus rmmod leaks.
2. The sd.c sets blksize_size and clears blk_size, which looks
dubious.
Are these two bugs or not?
Cheers,
-- Pete
--- linux-2.4.18-pre4/drivers/scsi/sd.c.0 Mon Jan 21 21:22:25 2002
+++ linux-2.4.18-pre4/drivers/scsi/sd.c Mon Jan 21 21:22:43 2002
@@ -1412,10 +1412,14 @@
kfree(sd_blocksizes);
kfree(sd_hardsizes);
kfree((char *) sd);
+ for (i = 0; i < N_USED_SD_MAJORS; i++) {
+ kfree(sd_gendisks[i].de_arr);
+ kfree(sd_gendisks[i].flags);
+ }
}
for (i = 0; i < N_USED_SD_MAJORS; i++) {
del_gendisk(&sd_gendisks[i]);
- blk_size[SD_MAJOR(i)] = NULL;
+ blksize_size[SD_MAJOR(i)] = NULL;
hardsect_size[SD_MAJOR(i)] = NULL;
read_ahead[SD_MAJOR(i)] = 0;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-01-22 5:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-22 5:48 Two small things around sd_init() in 2.4.18-pre4 Pete Zaitcev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox