diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-09 18:17:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-09 18:17:49 -0500 |
commit | 4c31c30302358ce1d253f915a064722db33c2114 (patch) | |
tree | f592738f7d3f1ed1640f28db6c2b987fc826ba65 /drivers/block/pktcdvd.c | |
parent | c4888f9ffafe7db107b7eafb3a68eaeeff3779c3 (diff) | |
parent | 2ad8b1ef11c98c5603580878aebf9f1bc74129e4 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
Add UNPLUG traces to all appropriate places
block: fix requeue handling in blk_queue_invalidate_tags()
mmc: Fix sg helper copy-and-paste error
pktcdvd: fix BUG caused by sysfs module reference semantics change
ioprio: allow sys_ioprio_set() value of 0 to reset ioprio setting
cfq_idle_class_timer: add paranoid checks for jiffies overflow
cfq: fix IOPRIO_CLASS_IDLE delays
cfq: fix IOPRIO_CLASS_IDLE accounting
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r-- | 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 a8130a4ad6d4..a5ee21319d37 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, | |||
358 | size_t count) | 358 | size_t count) |
359 | { | 359 | { |
360 | unsigned int major, minor; | 360 | unsigned int major, minor; |
361 | |||
361 | if (sscanf(buf, "%u:%u", &major, &minor) == 2) { | 362 | if (sscanf(buf, "%u:%u", &major, &minor) == 2) { |
363 | /* pkt_setup_dev() expects caller to hold reference to self */ | ||
364 | if (!try_module_get(THIS_MODULE)) | ||
365 | return -ENODEV; | ||
366 | |||
362 | pkt_setup_dev(MKDEV(major, minor), NULL); | 367 | pkt_setup_dev(MKDEV(major, minor), NULL); |
368 | |||
369 | module_put(THIS_MODULE); | ||
370 | |||
363 | return count; | 371 | return count; |
364 | } | 372 | } |
373 | |||
365 | return -EINVAL; | 374 | return -EINVAL; |
366 | } | 375 | } |
367 | 376 | ||