aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorIgor Murzov <intergalactic.anonymous@gmail.com>2012-03-30 13:32:09 -0400
committerLen Brown <len.brown@intel.com>2012-03-30 15:47:52 -0400
commitb60e7f6166857c76871977794fa266b02da1f394 (patch)
treee101d6548b7a841ffca1e20fd10cf54f4d80bace /drivers/acpi
parentea9f8856bd6d4ed45885b06a338f7362cd6c60e5 (diff)
ACPI video: Don't start video device until its associated input device has been allocated
Quoth Dmitry Torokhov: In addition to bus notifier we do install device notifier explicitly so it might fire up early. The easiest fox would be to move acpi_video_bus_start_devices() after input_allocate_device() but before input_register_device() - unregistered input devices can handle input_event() calls just fine. May fix crashes reported in: https://bugzilla.kernel.org/show_bug.cgi?id=40672 Signed-off-by: Igor Murzov <e-mail@date.by> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/video.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 462486b9f9b2..9577b6fa2650 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1658,16 +1658,17 @@ static int acpi_video_bus_add(struct acpi_device *device)
1658 error = acpi_video_bus_get_devices(video, device); 1658 error = acpi_video_bus_get_devices(video, device);
1659 if (error) 1659 if (error)
1660 goto err_free_video; 1660 goto err_free_video;
1661 error = acpi_video_bus_start_devices(video);
1662 if (error)
1663 goto err_put_video;
1664 1661
1665 video->input = input = input_allocate_device(); 1662 video->input = input = input_allocate_device();
1666 if (!input) { 1663 if (!input) {
1667 error = -ENOMEM; 1664 error = -ENOMEM;
1668 goto err_stop_video; 1665 goto err_put_video;
1669 } 1666 }
1670 1667
1668 error = acpi_video_bus_start_devices(video);
1669 if (error)
1670 goto err_free_input_dev;
1671
1671 snprintf(video->phys, sizeof(video->phys), 1672 snprintf(video->phys, sizeof(video->phys),
1672 "%s/video/input0", acpi_device_hid(video->device)); 1673 "%s/video/input0", acpi_device_hid(video->device));
1673 1674
@@ -1688,7 +1689,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
1688 1689
1689 error = input_register_device(input); 1690 error = input_register_device(input);
1690 if (error) 1691 if (error)
1691 goto err_free_input_dev; 1692 goto err_stop_video;
1692 1693
1693 printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s rom: %s post: %s)\n", 1694 printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s rom: %s post: %s)\n",
1694 ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device), 1695 ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
@@ -1706,10 +1707,10 @@ static int acpi_video_bus_add(struct acpi_device *device)
1706 1707
1707 err_unregister_input_dev: 1708 err_unregister_input_dev:
1708 input_unregister_device(input); 1709 input_unregister_device(input);
1709 err_free_input_dev:
1710 input_free_device(input);
1711 err_stop_video: 1710 err_stop_video:
1712 acpi_video_bus_stop_devices(video); 1711 acpi_video_bus_stop_devices(video);
1712 err_free_input_dev:
1713 input_free_device(input);
1713 err_put_video: 1714 err_put_video:
1714 acpi_video_bus_put_devices(video); 1715 acpi_video_bus_put_devices(video);
1715 kfree(video->attached_array); 1716 kfree(video->attached_array);