diff options
Diffstat (limited to 'drivers/s390/block/dasd_ioctl.c')
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 478bcdb90b6f..7039d9cf0fb4 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/blkpg.h> | 18 | #include <linux/blkpg.h> |
19 | #include <linux/smp_lock.h> | 19 | #include <linux/smp_lock.h> |
20 | 20 | #include <asm/compat.h> | |
21 | #include <asm/ccwdev.h> | 21 | #include <asm/ccwdev.h> |
22 | #include <asm/cmb.h> | 22 | #include <asm/cmb.h> |
23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
@@ -260,7 +260,7 @@ static int dasd_ioctl_information(struct dasd_block *block, | |||
260 | struct ccw_dev_id dev_id; | 260 | struct ccw_dev_id dev_id; |
261 | 261 | ||
262 | base = block->base; | 262 | base = block->base; |
263 | if (!base->discipline->fill_info) | 263 | if (!base->discipline || !base->discipline->fill_info) |
264 | return -EINVAL; | 264 | return -EINVAL; |
265 | 265 | ||
266 | dasd_info = kzalloc(sizeof(struct dasd_information2_t), GFP_KERNEL); | 266 | dasd_info = kzalloc(sizeof(struct dasd_information2_t), GFP_KERNEL); |
@@ -303,10 +303,7 @@ static int dasd_ioctl_information(struct dasd_block *block, | |||
303 | dasd_info->features |= | 303 | dasd_info->features |= |
304 | ((base->features & DASD_FEATURE_READONLY) != 0); | 304 | ((base->features & DASD_FEATURE_READONLY) != 0); |
305 | 305 | ||
306 | if (base->discipline) | 306 | memcpy(dasd_info->type, base->discipline->name, 4); |
307 | memcpy(dasd_info->type, base->discipline->name, 4); | ||
308 | else | ||
309 | memcpy(dasd_info->type, "none", 4); | ||
310 | 307 | ||
311 | if (block->request_queue->request_fn) { | 308 | if (block->request_queue->request_fn) { |
312 | struct list_head *l; | 309 | struct list_head *l; |
@@ -358,9 +355,8 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) | |||
358 | } | 355 | } |
359 | 356 | ||
360 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, | 357 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, |
361 | unsigned long arg) | 358 | struct cmbdata __user *argp) |
362 | { | 359 | { |
363 | struct cmbdata __user *argp = (void __user *) arg; | ||
364 | size_t size = _IOC_SIZE(cmd); | 360 | size_t size = _IOC_SIZE(cmd); |
365 | struct cmbdata data; | 361 | struct cmbdata data; |
366 | int ret; | 362 | int ret; |
@@ -376,7 +372,12 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, | |||
376 | unsigned int cmd, unsigned long arg) | 372 | unsigned int cmd, unsigned long arg) |
377 | { | 373 | { |
378 | struct dasd_block *block = bdev->bd_disk->private_data; | 374 | struct dasd_block *block = bdev->bd_disk->private_data; |
379 | void __user *argp = (void __user *)arg; | 375 | void __user *argp; |
376 | |||
377 | if (is_compat_task()) | ||
378 | argp = compat_ptr(arg); | ||
379 | else | ||
380 | argp = (void __user *)arg; | ||
380 | 381 | ||
381 | if (!block) | 382 | if (!block) |
382 | return -ENODEV; | 383 | return -ENODEV; |
@@ -414,7 +415,7 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, | |||
414 | case BIODASDCMFDISABLE: | 415 | case BIODASDCMFDISABLE: |
415 | return disable_cmf(block->base->cdev); | 416 | return disable_cmf(block->base->cdev); |
416 | case BIODASDREADALLCMB: | 417 | case BIODASDREADALLCMB: |
417 | return dasd_ioctl_readall_cmb(block, cmd, arg); | 418 | return dasd_ioctl_readall_cmb(block, cmd, argp); |
418 | default: | 419 | default: |
419 | /* if the discipline has an ioctl method try it. */ | 420 | /* if the discipline has an ioctl method try it. */ |
420 | if (block->base->discipline->ioctl) { | 421 | if (block->base->discipline->ioctl) { |