From: Rob Taylor Date: Thu, 23 Jul 2015 12:21:43 +0000 (-0300) Subject: [media] media: rcar_vin: Reject videobufs that are too small for current format X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4284118058b2b4f217a050908a555d0e1ed58641;p=linux-beck.git [media] media: rcar_vin: Reject videobufs that are too small for current format In videobuf_setup reject buffers that are too small for the configured format. Fixes v4l2-compliance issue. Signed-off-by: Rob Taylor Reviewed-by: William Towle Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 6abef82b204f..71dd71c0bd1f 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -541,6 +541,9 @@ static int rcar_vin_videobuf_setup(struct vb2_queue *vq, unsigned int bytes_per_line; int ret; + if (fmt->fmt.pix.sizeimage < icd->sizeimage) + return -EINVAL; + xlate = soc_camera_xlate_by_fourcc(icd, fmt->fmt.pix.pixelformat); if (!xlate)