aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/raw.c')
-rw-r--r--drivers/char/raw.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index b33e8ea314ed..b6de2c047145 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -324,13 +324,12 @@ static int __init raw_init(void)
324 max_raw_minors = MAX_RAW_MINORS; 324 max_raw_minors = MAX_RAW_MINORS;
325 } 325 }
326 326
327 raw_devices = vmalloc(sizeof(struct raw_device_data) * max_raw_minors); 327 raw_devices = vzalloc(sizeof(struct raw_device_data) * max_raw_minors);
328 if (!raw_devices) { 328 if (!raw_devices) {
329 printk(KERN_ERR "Not enough memory for raw device structures\n"); 329 printk(KERN_ERR "Not enough memory for raw device structures\n");
330 ret = -ENOMEM; 330 ret = -ENOMEM;
331 goto error; 331 goto error;
332 } 332 }
333 memset(raw_devices, 0, sizeof(struct raw_device_data) * max_raw_minors);
334 333
335 ret = register_chrdev_region(dev, max_raw_minors, "raw"); 334 ret = register_chrdev_region(dev, max_raw_minors, "raw");
336 if (ret) 335 if (ret)