diff options
author | Stefan Haberland <stefan.haberland@de.ibm.com> | 2010-01-27 10:12:35 +0100 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-01-27 10:12:48 +0100 |
commit | 294001a80c9810e2fe27aaaad7df8be12a103065 (patch) | |
tree | 1615733697057a38054f68bf46109fffeeb5e549 /drivers/s390/block/dasd_ioctl.c | |
parent | fnctl: f_modown should call write_lock_irqsave/restore (diff) | |
download | linux-294001a80c9810e2fe27aaaad7df8be12a103065.tar.xz linux-294001a80c9810e2fe27aaaad7df8be12a103065.zip |
[S390] dasd: fix possible NULL pointer errors
Fix possible NULL pointer in DASD messages and correct discipline
checking.
Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/dasd_ioctl.c')
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index fc7b30b4a255..7039d9cf0fb4 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -260,7 +260,7 @@ static int dasd_ioctl_information(struct dasd_block *block, struct ccw_dev_id dev_id; base = block->base; - if (!base->discipline->fill_info) + if (!base->discipline || !base->discipline->fill_info) return -EINVAL; dasd_info = kzalloc(sizeof(struct dasd_information2_t), GFP_KERNEL); @@ -303,10 +303,7 @@ static int dasd_ioctl_information(struct dasd_block *block, dasd_info->features |= ((base->features & DASD_FEATURE_READONLY) != 0); - if (base->discipline) - memcpy(dasd_info->type, base->discipline->name, 4); - else - memcpy(dasd_info->type, "none", 4); + memcpy(dasd_info->type, base->discipline->name, 4); if (block->request_queue->request_fn) { struct list_head *l; |