Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4a711e7 authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Mauro Carvalho Chehab
Browse files

[media] media: davinci: vpif: Add return code check at vb2_queue_init()



from commit with id 896f38f5
it's mandatory to check the return code of vb2_queue_init().

Signed-off-by: default avatarLad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: default avatarManjunath Hadli <manjunath.hadli@ti.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2bd4e58c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -976,6 +976,7 @@ static int vpif_reqbufs(struct file *file, void *priv,
	struct common_obj *common;
	u8 index = 0;
	struct vb2_queue *q;
	int ret;

	vpif_dbg(2, debug, "vpif_reqbufs\n");

@@ -1015,8 +1016,12 @@ static int vpif_reqbufs(struct file *file, void *priv,
	q->mem_ops = &vb2_dma_contig_memops;
	q->buf_struct_size = sizeof(struct vpif_cap_buffer);

	vb2_queue_init(q);

	ret = vb2_queue_init(q);
	if (ret) {
		vpif_err("vpif_capture: vb2_queue_init() failed\n");
		vb2_dma_contig_cleanup_ctx(common->alloc_ctx);
		return ret;
	}
	/* Set io allowed member of file handle to TRUE */
	fh->io_allowed[index] = 1;
	/* Increment io usrs member of channel object to 1 */
+7 −2
Original line number Diff line number Diff line
@@ -936,6 +936,7 @@ static int vpif_reqbufs(struct file *file, void *priv,
	enum v4l2_field field;
	struct vb2_queue *q;
	u8 index = 0;
	int ret;

	/* This file handle has not initialized the channel,
	   It is not allowed to do settings */
@@ -981,8 +982,12 @@ static int vpif_reqbufs(struct file *file, void *priv,
	q->mem_ops = &vb2_dma_contig_memops;
	q->buf_struct_size = sizeof(struct vpif_disp_buffer);

	vb2_queue_init(q);

	ret = vb2_queue_init(q);
	if (ret) {
		vpif_err("vpif_display: vb2_queue_init() failed\n");
		vb2_dma_contig_cleanup_ctx(common->alloc_ctx);
		return ret;
	}
	/* Set io allowed member of file handle to TRUE */
	fh->io_allowed[index] = 1;
	/* Increment io usrs member of channel object to 1 */