X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Facpi%2Fvideo.c;h=d10668f146997d07c53630b722d15fad2054ed98;hb=bc61b0102a53ee0ced3a8747cd4afe656a453756;hp=e383d6109ae109c6963d43abe7ca71449e554518;hpb=2fc2991175bf77395e6b15fe6b2304d3bf72da40;p=powerpc.git diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index e383d6109a..d10668f146 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -334,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); } @@ -813,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)) @@ -1488,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; @@ -1645,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); } @@ -1831,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);