X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Facpi%2Fvideo.c;h=d10668f146997d07c53630b722d15fad2054ed98;hb=bc61b0102a53ee0ced3a8747cd4afe656a453756;hp=b9132b5ac0f0f29e73880089addc2ad27655143d;hpb=89ef1a21a174a4f581a4b6973f9a9f9ee28a9304;p=powerpc.git diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index b9132b5ac0..d10668f146 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -297,11 +297,12 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state) int status; union acpi_object arg0 = { ACPI_TYPE_INTEGER }; struct acpi_object_list args = { 1, &arg0 }; + unsigned long ret; ACPI_FUNCTION_TRACE("acpi_video_device_set_state"); arg0.integer.value = state; - status = acpi_evaluate_integer(device->handle, "_DSS", &args, NULL); + status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret); return_VALUE(status); } @@ -333,8 +334,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device, return_VALUE(0); err: - if (buffer.pointer) - kfree(buffer.pointer); + kfree(buffer.pointer); return_VALUE(status); } @@ -812,7 +812,7 @@ acpi_video_device_write_brightness(struct file *file, ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness"); - if (!dev || count + 1 > sizeof str) + if (!dev || !dev->brightness || count + 1 > sizeof str) return_VALUE(-EINVAL); if (copy_from_user(str, buffer, count)) @@ -1487,8 +1487,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) } active_device_list[count].value.int_val = ACPI_VIDEO_HEAD_END; - if (video->attached_array) - kfree(video->attached_array); + kfree(video->attached_array); video->attached_array = active_device_list; video->attached_count = count; @@ -1644,8 +1643,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) printk(KERN_WARNING PREFIX "hhuuhhuu bug in acpi video driver.\n"); - if (data->brightness) - kfree(data->brightness); + kfree(data->brightness); kfree(data); } @@ -1830,8 +1828,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) acpi_video_bus_put_devices(video); acpi_video_bus_remove_fs(device); - if (video->attached_array) - kfree(video->attached_array); + kfree(video->attached_array); kfree(video); return_VALUE(0);