lkml.org 
[lkml]   [2002]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectTwo small things around sd_init() in 2.4.18-pre4
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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:15    [W:0.025 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site