Commit 5dd6946c authored by Wei Yongjun's avatar Wei Yongjun Committed by Mauro Carvalho Chehab

[media] v4l: vb2: fix error return code in __vb2_init_fileio()

Fix to return -EINVAL in the get kernel address error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Acked-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 99119595
...@@ -2193,8 +2193,10 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read) ...@@ -2193,8 +2193,10 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read)
*/ */
for (i = 0; i < q->num_buffers; i++) { for (i = 0; i < q->num_buffers; i++) {
fileio->bufs[i].vaddr = vb2_plane_vaddr(q->bufs[i], 0); 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; goto err_reqbufs;
}
fileio->bufs[i].size = vb2_plane_size(q->bufs[i], 0); fileio->bufs[i].size = vb2_plane_size(q->bufs[i], 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment