diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 71fa1011715f..2cf264fd52e0 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -564,12 +564,13 @@ acpi_video_device_find_cap (struct acpi_video_device *device) | |||
564 | int count = 0; | 564 | int count = 0; |
565 | union acpi_object *o; | 565 | union acpi_object *o; |
566 | 566 | ||
567 | br = kmalloc(sizeof &br, GFP_KERNEL); | 567 | br = kmalloc(sizeof(*br), GFP_KERNEL); |
568 | if (!br) { | 568 | if (!br) { |
569 | printk(KERN_ERR "can't allocate memory\n"); | 569 | printk(KERN_ERR "can't allocate memory\n"); |
570 | } else { | 570 | } else { |
571 | memset(br, 0, sizeof &br); | 571 | memset(br, 0, sizeof(*br)); |
572 | br->levels = kmalloc(obj->package.count * sizeof &br->levels, GFP_KERNEL); | 572 | br->levels = kmalloc(obj->package.count * |
573 | sizeof *(br->levels), GFP_KERNEL); | ||
573 | if (!br->levels) | 574 | if (!br->levels) |
574 | goto out; | 575 | goto out; |
575 | 576 | ||
@@ -584,8 +585,7 @@ acpi_video_device_find_cap (struct acpi_video_device *device) | |||
584 | } | 585 | } |
585 | out: | 586 | out: |
586 | if (count < 2) { | 587 | if (count < 2) { |
587 | if (br->levels) | 588 | kfree(br->levels); |
588 | kfree(br->levels); | ||
589 | kfree(br); | 589 | kfree(br); |
590 | } else { | 590 | } else { |
591 | br->count = count; | 591 | br->count = count; |
@@ -595,8 +595,7 @@ out: | |||
595 | } | 595 | } |
596 | } | 596 | } |
597 | 597 | ||
598 | if (obj) | 598 | kfree(obj); |
599 | kfree(obj); | ||
600 | 599 | ||
601 | return_VOID; | 600 | return_VOID; |
602 | } | 601 | } |
@@ -1585,7 +1584,7 @@ acpi_video_switch_output( | |||
1585 | ACPI_FUNCTION_TRACE("acpi_video_switch_output"); | 1584 | ACPI_FUNCTION_TRACE("acpi_video_switch_output"); |
1586 | 1585 | ||
1587 | list_for_each_safe(node, next, &video->video_device_list) { | 1586 | list_for_each_safe(node, next, &video->video_device_list) { |
1588 | struct acpi_video_device * dev = container_of(node, struct acpi_video_device, entry); | 1587 | dev = container_of(node, struct acpi_video_device, entry); |
1589 | status = acpi_video_device_get_state(dev, &state); | 1588 | status = acpi_video_device_get_state(dev, &state); |
1590 | if (state & 0x2){ | 1589 | if (state & 0x2){ |
1591 | dev_next = container_of(node->next, struct acpi_video_device, entry); | 1590 | dev_next = container_of(node->next, struct acpi_video_device, entry); |