diff options
Diffstat (limited to 'drivers/s390/cio/device_ops.c')
-rw-r--r-- | drivers/s390/cio/device_ops.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index 3a50b1903287..795abb5a65ba 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c | |||
@@ -359,10 +359,9 @@ read_dev_chars (struct ccw_device *cdev, void **buffer, int length) | |||
359 | CIO_TRACE_EVENT (4, "rddevch"); | 359 | CIO_TRACE_EVENT (4, "rddevch"); |
360 | CIO_TRACE_EVENT (4, sch->dev.bus_id); | 360 | CIO_TRACE_EVENT (4, sch->dev.bus_id); |
361 | 361 | ||
362 | rdc_ccw = kmalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); | 362 | rdc_ccw = kzalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); |
363 | if (!rdc_ccw) | 363 | if (!rdc_ccw) |
364 | return -ENOMEM; | 364 | return -ENOMEM; |
365 | memset(rdc_ccw, 0, sizeof(struct ccw1)); | ||
366 | rdc_ccw->cmd_code = CCW_CMD_RDC; | 365 | rdc_ccw->cmd_code = CCW_CMD_RDC; |
367 | rdc_ccw->count = length; | 366 | rdc_ccw->count = length; |
368 | rdc_ccw->flags = CCW_FLAG_SLI; | 367 | rdc_ccw->flags = CCW_FLAG_SLI; |
@@ -426,16 +425,14 @@ read_conf_data_lpm (struct ccw_device *cdev, void **buffer, int *length, __u8 lp | |||
426 | if (!ciw || ciw->cmd == 0) | 425 | if (!ciw || ciw->cmd == 0) |
427 | return -EOPNOTSUPP; | 426 | return -EOPNOTSUPP; |
428 | 427 | ||
429 | rcd_ccw = kmalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); | 428 | rcd_ccw = kzalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); |
430 | if (!rcd_ccw) | 429 | if (!rcd_ccw) |
431 | return -ENOMEM; | 430 | return -ENOMEM; |
432 | memset(rcd_ccw, 0, sizeof(struct ccw1)); | 431 | rcd_buf = kzalloc(ciw->count, GFP_KERNEL | GFP_DMA); |
433 | rcd_buf = kmalloc(ciw->count, GFP_KERNEL | GFP_DMA); | ||
434 | if (!rcd_buf) { | 432 | if (!rcd_buf) { |
435 | kfree(rcd_ccw); | 433 | kfree(rcd_ccw); |
436 | return -ENOMEM; | 434 | return -ENOMEM; |
437 | } | 435 | } |
438 | memset (rcd_buf, 0, ciw->count); | ||
439 | rcd_ccw->cmd_code = ciw->cmd; | 436 | rcd_ccw->cmd_code = ciw->cmd; |
440 | rcd_ccw->cda = (__u32) __pa (rcd_buf); | 437 | rcd_ccw->cda = (__u32) __pa (rcd_buf); |
441 | rcd_ccw->count = ciw->count; | 438 | rcd_ccw->count = ciw->count; |