summaryrefslogtreecommitdiff
path: root/drivers/s390/block/dasd_ioctl.c
diff options
context:
space:
mode:
authorStefan Haberland <stefan.haberland@de.ibm.com>2010-01-27 12:12:35 +0300
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-01-27 12:12:48 +0300
commit294001a80c9810e2fe27aaaad7df8be12a103065 (patch)
tree1615733697057a38054f68bf46109fffeeb5e549 /drivers/s390/block/dasd_ioctl.c
parentb04da8bfdfbbd79544cab2fadfdc12e87eb01600 (diff)
downloadlinux-294001a80c9810e2fe27aaaad7df8be12a103065.tar.xz
[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.c7
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;