Messages in this thread | | | Subject | Re: [PATCH] CDRW packet writing support for 2.6.7-bk13 | From | Peter Osterlund <> | Date | 04 Jul 2004 13:57:07 +0200 |
| |
Andrew Morton <akpm@osdl.org> writes:
> Peter Osterlund <petero2@telia.com> wrote: > > > > > Oop, sorry, yes. Peter, are you sure this is where the leak is coming from? > > > > I'm sure that the module reference count as reported by lsmod > > increases each time I access /proc/driver/pktcdvd/pktcdvd0. I can make > > this problem go away either by patching __bdevname() or by deleting > > the call to __bdevname() in pktcdvd.c. > > Can't you use bdevname(pd->bdev) in there?
Not without more changes, because pd->bdev is only non-NULL when the device is actually opened by someone. When the device is setup (ie mapped to a real device) but not opened, pd->bdev (a struct block_device *) is NULL and pd->dev (a dev_t) is the only thing that keeps track of the mapping between the packet device and the real device.
Maybe that's a bad design though. Perhaps pd->dev can be eliminated altogether.
But anyway, if __bdevname() leaks a module reference it should get fixed, right?
-- 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/
| |