lkml.org 
[lkml]   [2004]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] CDRW packet writing support for 2.6.7-bk13
From
Date
Peter Osterlund <petero2@telia.com> writes:

> This patch implements CDRW packet writing as a kernel block device.
> Usage instructions are in the packet-writing.txt file.
...
> +static int pkt_proc_device(struct pktcdvd_device *pd, char *buf)
> +{
> + char *b = buf, *msg;
> + char bdev_buf[BDEVNAME_SIZE];
> + int states[PACKET_NUM_STATES];
> +
> + b += sprintf(b, "\nWriter %s mapped to %s:\n", pd->name,
> + __bdevname(pd->dev, bdev_buf));

This code leaks a module reference. The patch below fixes it. I'm not
sure it's correct, but do_open() also does module_put() after
put_disk().

Signed-off-by: Peter Osterlund <petero2@telia.com>

---

linux-petero/fs/partitions/check.c | 1 +
1 files changed, 1 insertion(+)

diff -puN fs/partitions/check.c~packet-refcnt fs/partitions/check.c
--- linux/fs/partitions/check.c~packet-refcnt 2004-07-02 23:18:22.000000000 +0200
+++ linux-petero/fs/partitions/check.c 2004-07-02 23:18:23.000000000 +0200
@@ -151,6 +151,7 @@ const char *__bdevname(dev_t dev, char *
if (disk) {
buffer = disk_name(disk, part, buffer);
put_disk(disk);
+ module_put(disk->fops->owner);
} else {
snprintf(buffer, BDEVNAME_SIZE, "unknown-block(%u,%u)",
MAJOR(dev), MINOR(dev));
_
--
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340
-
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 14:04    [W:0.145 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site