aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_ioctl.c
diff options
context:
space:
mode:
authorStefan Haberland <stefan.haberland@de.ibm.com>2010-01-27 04:12:35 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-01-27 04:12:48 -0500
commit294001a80c9810e2fe27aaaad7df8be12a103065 (patch)
tree1615733697057a38054f68bf46109fffeeb5e549 /drivers/s390/block/dasd_ioctl.c
parentb04da8bfdfbbd79544cab2fadfdc12e87eb01600 (diff)
[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,
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;