aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:52:36 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:52:36 -0400
commit37224470c8c6d90a4062e76a08d4dc1fcf91fc89 (patch)
tree627f537177bf8e951c12bec04c4a85f0125f5ece /drivers/acpi/video.c
parente83319510b04dd51a60da8a0b4ccf8b92b3ab1ad (diff)
parentae6c859b7dcd708efadf1c76279c33db213e3506 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (65 commits) ACPI: suppress power button event on S3 resume ACPI: resolve merge conflict between sem2mutex and processor_perflib.c ACPI: use for_each_possible_cpu() instead of for_each_cpu() ACPI: delete newly added debugging macros in processor_perflib.c ACPI: UP build fix for bugzilla-5737 Enable P-state software coordination via _PDC P-state software coordination for speedstep-centrino P-state software coordination for acpi-cpufreq P-state software coordination for ACPI core ACPI: create acpi_thermal_resume() ACPI: create acpi_fan_suspend()/acpi_fan_resume() ACPI: pass pm_message_t from acpi_device_suspend() to root_suspend() ACPI: create acpi_device_suspend()/acpi_device_resume() ACPI: replace spin_lock_irq with mutex for ec poll mode ACPI: Allow a WAN module enable/disable on a Thinkpad X60. sem2mutex: acpi, acpi_link_lock ACPI: delete unused acpi_bus_drivers_lock sem2mutex: drivers/acpi/processor_perflib.c ACPI add ia64 exports to build acpi_memhotplug as a module ACPI: asus_acpi_init(): propagate correct return value ... Manual resolve of conflicts in: arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c include/acpi/processor.h
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index bd4887518373..86531ab4ee55 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -323,7 +323,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
323 if (!ACPI_SUCCESS(status)) 323 if (!ACPI_SUCCESS(status))
324 return_VALUE(status); 324 return_VALUE(status);
325 obj = (union acpi_object *)buffer.pointer; 325 obj = (union acpi_object *)buffer.pointer;
326 if (!obj && (obj->type != ACPI_TYPE_PACKAGE)) { 326 if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
327 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _BCL data\n")); 327 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _BCL data\n"));
328 status = -EFAULT; 328 status = -EFAULT;
329 goto err; 329 goto err;
@@ -1294,7 +1294,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1294 struct acpi_video_bus *video) 1294 struct acpi_video_bus *video)
1295{ 1295{
1296 unsigned long device_id; 1296 unsigned long device_id;
1297 int status, result; 1297 int status;
1298 struct acpi_video_device *data; 1298 struct acpi_video_device *data;
1299 1299
1300 ACPI_FUNCTION_TRACE("acpi_video_bus_get_one_device"); 1300 ACPI_FUNCTION_TRACE("acpi_video_bus_get_one_device");
@@ -1346,8 +1346,11 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1346 if (ACPI_FAILURE(status)) { 1346 if (ACPI_FAILURE(status)) {
1347 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1347 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1348 "Error installing notify handler\n")); 1348 "Error installing notify handler\n"));
1349 result = -ENODEV; 1349 if(data->brightness)
1350 goto end; 1350 kfree(data->brightness->levels);
1351 kfree(data->brightness);
1352 kfree(data);
1353 return -ENODEV;
1351 } 1354 }
1352 1355
1353 down(&video->sem); 1356 down(&video->sem);
@@ -1359,7 +1362,6 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1359 return_VALUE(0); 1362 return_VALUE(0);
1360 } 1363 }
1361 1364
1362 end:
1363 return_VALUE(-ENOENT); 1365 return_VALUE(-ENOENT);
1364} 1366}
1365 1367
@@ -1643,8 +1645,9 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
1643 printk(KERN_WARNING PREFIX 1645 printk(KERN_WARNING PREFIX
1644 "hhuuhhuu bug in acpi video driver.\n"); 1646 "hhuuhhuu bug in acpi video driver.\n");
1645 1647
1648 if (data->brightness);
1649 kfree(data->brightness->levels);
1646 kfree(data->brightness); 1650 kfree(data->brightness);
1647
1648 kfree(data); 1651 kfree(data);
1649 } 1652 }
1650 1653
@@ -1785,6 +1788,10 @@ static int acpi_video_bus_add(struct acpi_device *device)
1785 if (ACPI_FAILURE(status)) { 1788 if (ACPI_FAILURE(status)) {
1786 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 1789 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1787 "Error installing notify handler\n")); 1790 "Error installing notify handler\n"));
1791 acpi_video_bus_stop_devices(video);
1792 acpi_video_bus_put_devices(video);
1793 kfree(video->attached_array);
1794 acpi_video_bus_remove_fs(device);
1788 result = -ENODEV; 1795 result = -ENODEV;
1789 goto end; 1796 goto end;
1790 } 1797 }
@@ -1796,10 +1803,8 @@ static int acpi_video_bus_add(struct acpi_device *device)
1796 video->flags.post ? "yes" : "no"); 1803 video->flags.post ? "yes" : "no");
1797 1804
1798 end: 1805 end:
1799 if (result) { 1806 if (result)
1800 acpi_video_bus_remove_fs(device);
1801 kfree(video); 1807 kfree(video);
1802 }
1803 1808
1804 return_VALUE(result); 1809 return_VALUE(result);
1805} 1810}