forked from luck/tmp_suning_uos_patched
char: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
57f3224c3f
commit
8e03bd6525
|
@ -171,7 +171,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
|
||||||
}
|
}
|
||||||
got_gatt = 1;
|
got_gatt = 1;
|
||||||
|
|
||||||
bridge->key_list = vmalloc(PAGE_SIZE * 4);
|
bridge->key_list = vzalloc(PAGE_SIZE * 4);
|
||||||
if (bridge->key_list == NULL) {
|
if (bridge->key_list == NULL) {
|
||||||
dev_err(&bridge->dev->dev,
|
dev_err(&bridge->dev->dev,
|
||||||
"can't allocate memory for key lists\n");
|
"can't allocate memory for key lists\n");
|
||||||
|
@ -181,7 +181,6 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
|
||||||
got_keylist = 1;
|
got_keylist = 1;
|
||||||
|
|
||||||
/* FIXME vmalloc'd memory not guaranteed contiguous */
|
/* FIXME vmalloc'd memory not guaranteed contiguous */
|
||||||
memset(bridge->key_list, 0, PAGE_SIZE * 4);
|
|
||||||
|
|
||||||
if (bridge->driver->configure()) {
|
if (bridge->driver->configure()) {
|
||||||
dev_err(&bridge->dev->dev, "error configuring host chipset\n");
|
dev_err(&bridge->dev->dev, "error configuring host chipset\n");
|
||||||
|
|
|
@ -324,13 +324,12 @@ static int __init raw_init(void)
|
||||||
max_raw_minors = MAX_RAW_MINORS;
|
max_raw_minors = MAX_RAW_MINORS;
|
||||||
}
|
}
|
||||||
|
|
||||||
raw_devices = vmalloc(sizeof(struct raw_device_data) * max_raw_minors);
|
raw_devices = vzalloc(sizeof(struct raw_device_data) * max_raw_minors);
|
||||||
if (!raw_devices) {
|
if (!raw_devices) {
|
||||||
printk(KERN_ERR "Not enough memory for raw device structures\n");
|
printk(KERN_ERR "Not enough memory for raw device structures\n");
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
memset(raw_devices, 0, sizeof(struct raw_device_data) * max_raw_minors);
|
|
||||||
|
|
||||||
ret = register_chrdev_region(dev, max_raw_minors, "raw");
|
ret = register_chrdev_region(dev, max_raw_minors, "raw");
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user