Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fffe487d59ba4017c7c62b06667ca4a226cee651 Commit: fffe487d59ba4017c7c62b06667ca4a226cee651 Parent: 8ec680e4c3ec818efd1652f15199ed1c216ab550 Author: Tejun Heo <[EMAIL PROTECTED]> AuthorDate: Thu Nov 8 08:00:24 2007 +0100 Committer: Jens Axboe <[EMAIL PROTECTED]> CommitDate: Thu Nov 8 08:00:24 2007 +0100
pktcdvd: fix BUG caused by sysfs module reference semantics change pkt_setup_dev() expects module reference to be held on invocation. This used to be true for sysfs callbacks but not anymore. Test and grab module reference around pkt_setup_dev() in class_pktcdvd_store_add(). Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> Acked-by: Peter Osterlund <[EMAIL PROTECTED]> Signed-off-by: Jens Axboe <[EMAIL PROTECTED]> --- drivers/block/pktcdvd.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index a8130a4..a5ee213 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -358,10 +358,19 @@ static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf, size_t count) { unsigned int major, minor; + if (sscanf(buf, "%u:%u", &major, &minor) == 2) { + /* pkt_setup_dev() expects caller to hold reference to self */ + if (!try_module_get(THIS_MODULE)) + return -ENODEV; + pkt_setup_dev(MKDEV(major, minor), NULL); + + module_put(THIS_MODULE); + return count; } + return -EINVAL; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html