From: Pete Zaitcev <zaitcev@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org, zaitcev@redhat.com
Subject: Two small things around sd_init() in 2.4.18-pre4
Date: Tue, 22 Jan 2002 00:48:57 -0500 [thread overview]
Message-ID: <20020122004857.B21332@devserv.devel.redhat.com> (raw)
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;
}
reply other threads:[~2002-01-22 5:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020122004857.B21332@devserv.devel.redhat.com \
--to=zaitcev@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox