[media] v4l: vb2: fix error return code in __vb2_init_fileio()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 13 May 2013 04:48:45 +0000 (01:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 27 May 2013 11:51:36 +0000 (08:51 -0300)
Fix to return -EINVAL in the get kernel address error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/videobuf2-core.c

index 7d833eefaf4e9bf2124f035db614179127268e4a..7bd3ee67727dc122bfa1dbc5f309b7241ef5be8d 100644 (file)
@@ -2193,8 +2193,10 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read)
         */
        for (i = 0; i < q->num_buffers; i++) {
                fileio->bufs[i].vaddr = vb2_plane_vaddr(q->bufs[i], 0);
-               if (fileio->bufs[i].vaddr == NULL)
+               if (fileio->bufs[i].vaddr == NULL) {
+                       ret = -EINVAL;
                        goto err_reqbufs;
+               }
                fileio->bufs[i].size = vb2_plane_size(q->bufs[i], 0);
        }