V4L/DVB (3193): Replace del_timer with del_timer_sync
[powerpc.git] / drivers / acpi / video.c
index e383d61..d10668f 100644 (file)
@@ -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);