media: v4l2: tegra: fixing memory access oops in tegra camera driver
Bryan Wu [Wed, 9 Jan 2013 18:29:55 +0000 (10:29 -0800)]
Function pointer int (*queue_setup)() of struct vb2_ops in
include/media/videobuf2-core.h is not compatible with our function
call tegra_camera_videobuf_setup(). So building will generate warning
and it will cause alloc_ctxs[] with wrong value, then introduce
memory access oops later.

Bug 1215617

Change-Id: I5d49ccd611a9435a5ee3b21e344bc0b5464ba747
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/190036
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Andrew Chew <achew@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

drivers/media/video/tegra_v4l2_camera.c

index 990f6af..644d0be 100644 (file)
@@ -1058,10 +1058,9 @@ static void tegra_camera_init_buffer(struct tegra_camera_dev *pcdev,
  *  Videobuf operations
  */
 static int tegra_camera_videobuf_setup(struct vb2_queue *vq,
-                                      const struct v4l2_format *fmt,
                                       unsigned int *num_buffers,
                                       unsigned int *num_planes,
-                                      unsigned int sizes[],
+                                      unsigned long sizes[],
                                       void *alloc_ctxs[])
 {
        struct soc_camera_device *icd = container_of(vq,
@@ -1321,7 +1320,8 @@ static void tegra_camera_remove_device(struct soc_camera_device *icd)
                icd->devnum);
 }
 
-static int tegra_camera_set_bus_param(struct soc_camera_device *icd)
+static int tegra_camera_set_bus_param(struct soc_camera_device *icd,
+                                       __u32 pixfmt)
 {
        return 0;
 }