[PATCH] s390: random values in result of BIODASDINFO2
authorHorst Hummel <horst.hummel@de.ibm.com>
Fri, 24 Mar 2006 11:15:24 +0000 (03:15 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 24 Mar 2006 15:33:17 +0000 (07:33 -0800)
Use kzalloc to get a zeroed buffer for the structure returned to user space by
the BIODASDINFO2 ioctl.  Not all fields are set up, e.g.  the read_devno is
missing.

Signed-off-by: Horst Hummel <horst.hummel@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/s390/block/dasd_ioctl.c

index e1dc0ffee027afe1e90a9ec31c5db93a35b812b4..d0c2d732dcff574d0596222b8510a9279f431cb2 100644 (file)
@@ -260,7 +260,7 @@ dasd_ioctl_information(struct dasd_device *device,
        if (!device->discipline->fill_info)
                return -EINVAL;
 
-       dasd_info = kmalloc(sizeof(struct dasd_information2_t), GFP_KERNEL);
+       dasd_info = kzalloc(sizeof(struct dasd_information2_t), GFP_KERNEL);
        if (dasd_info == NULL)
                return -ENOMEM;
 
@@ -303,8 +303,7 @@ dasd_ioctl_information(struct dasd_device *device,
                memcpy(dasd_info->type, device->discipline->name, 4);
        else
                memcpy(dasd_info->type, "none", 4);
-       dasd_info->req_queue_len = 0;
-       dasd_info->chanq_len = 0;
+
        if (device->request_queue->request_fn) {
                struct list_head *l;
 #ifdef DASD_EXTENDED_PROFILING