aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index eb5141f9ef8f..36b37d755dbc 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -533,11 +533,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
533 int count = 0; 533 int count = 0;
534 union acpi_object *o; 534 union acpi_object *o;
535 535
536 br = kmalloc(sizeof(*br), GFP_KERNEL); 536 br = kzalloc(sizeof(*br), GFP_KERNEL);
537 if (!br) { 537 if (!br) {
538 printk(KERN_ERR "can't allocate memory\n"); 538 printk(KERN_ERR "can't allocate memory\n");
539 } else { 539 } else {
540 memset(br, 0, sizeof(*br));
541 br->levels = kmalloc(obj->package.count * 540 br->levels = kmalloc(obj->package.count *
542 sizeof *(br->levels), GFP_KERNEL); 541 sizeof *(br->levels), GFP_KERNEL);
543 if (!br->levels) 542 if (!br->levels)
@@ -1260,12 +1259,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1260 acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); 1259 acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
1261 if (ACPI_SUCCESS(status)) { 1260 if (ACPI_SUCCESS(status)) {
1262 1261
1263 data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL); 1262 data = kzalloc(sizeof(struct acpi_video_device), GFP_KERNEL);
1264 if (!data) 1263 if (!data)
1265 return -ENOMEM; 1264 return -ENOMEM;
1266 1265
1267 memset(data, 0, sizeof(struct acpi_video_device));
1268
1269 strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); 1266 strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
1270 strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); 1267 strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
1271 acpi_driver_data(device) = data; 1268 acpi_driver_data(device) = data;
@@ -1718,10 +1715,9 @@ static int acpi_video_bus_add(struct acpi_device *device)
1718 if (!device) 1715 if (!device)
1719 return -EINVAL; 1716 return -EINVAL;
1720 1717
1721 video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); 1718 video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL);
1722 if (!video) 1719 if (!video)
1723 return -ENOMEM; 1720 return -ENOMEM;
1724 memset(video, 0, sizeof(struct acpi_video_bus));
1725 1721
1726 video->device = device; 1722 video->device = device;
1727 strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); 1723 strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);