diff options
author | Lad, Prabhakar <prabhakar.lad@ti.com> | 2012-10-03 09:01:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-05 21:13:25 -0400 |
commit | b4a711e7bf59e556d5f692e0c65ef12c6dad6cf8 (patch) | |
tree | 86e0da70b8c52cdcd721770ec560183f2d456983 | |
parent | 2bd4e58c9d00325b7a850b2ac73fd902e9148b77 (diff) |
[media] media: davinci: vpif: Add return code check at vb2_queue_init()
from commit with id 896f38f582730a19eb49677105b4fe4c0270b82e
it's mandatory to check the return code of vb2_queue_init().
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/platform/davinci/vpif_capture.c | 9 | ||||
-rw-r--r-- | drivers/media/platform/davinci/vpif_display.c | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 83b80baf868a..cabd5a2c3718 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c | |||
@@ -976,6 +976,7 @@ static int vpif_reqbufs(struct file *file, void *priv, | |||
976 | struct common_obj *common; | 976 | struct common_obj *common; |
977 | u8 index = 0; | 977 | u8 index = 0; |
978 | struct vb2_queue *q; | 978 | struct vb2_queue *q; |
979 | int ret; | ||
979 | 980 | ||
980 | vpif_dbg(2, debug, "vpif_reqbufs\n"); | 981 | vpif_dbg(2, debug, "vpif_reqbufs\n"); |
981 | 982 | ||
@@ -1015,8 +1016,12 @@ static int vpif_reqbufs(struct file *file, void *priv, | |||
1015 | q->mem_ops = &vb2_dma_contig_memops; | 1016 | q->mem_ops = &vb2_dma_contig_memops; |
1016 | q->buf_struct_size = sizeof(struct vpif_cap_buffer); | 1017 | q->buf_struct_size = sizeof(struct vpif_cap_buffer); |
1017 | 1018 | ||
1018 | vb2_queue_init(q); | 1019 | ret = vb2_queue_init(q); |
1019 | 1020 | if (ret) { | |
1021 | vpif_err("vpif_capture: vb2_queue_init() failed\n"); | ||
1022 | vb2_dma_contig_cleanup_ctx(common->alloc_ctx); | ||
1023 | return ret; | ||
1024 | } | ||
1020 | /* Set io allowed member of file handle to TRUE */ | 1025 | /* Set io allowed member of file handle to TRUE */ |
1021 | fh->io_allowed[index] = 1; | 1026 | fh->io_allowed[index] = 1; |
1022 | /* Increment io usrs member of channel object to 1 */ | 1027 | /* Increment io usrs member of channel object to 1 */ |
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index ae8329d79242..7f20ca53b6f2 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c | |||
@@ -936,6 +936,7 @@ static int vpif_reqbufs(struct file *file, void *priv, | |||
936 | enum v4l2_field field; | 936 | enum v4l2_field field; |
937 | struct vb2_queue *q; | 937 | struct vb2_queue *q; |
938 | u8 index = 0; | 938 | u8 index = 0; |
939 | int ret; | ||
939 | 940 | ||
940 | /* This file handle has not initialized the channel, | 941 | /* This file handle has not initialized the channel, |
941 | It is not allowed to do settings */ | 942 | It is not allowed to do settings */ |
@@ -981,8 +982,12 @@ static int vpif_reqbufs(struct file *file, void *priv, | |||
981 | q->mem_ops = &vb2_dma_contig_memops; | 982 | q->mem_ops = &vb2_dma_contig_memops; |
982 | q->buf_struct_size = sizeof(struct vpif_disp_buffer); | 983 | q->buf_struct_size = sizeof(struct vpif_disp_buffer); |
983 | 984 | ||
984 | vb2_queue_init(q); | 985 | ret = vb2_queue_init(q); |
985 | 986 | if (ret) { | |
987 | vpif_err("vpif_display: vb2_queue_init() failed\n"); | ||
988 | vb2_dma_contig_cleanup_ctx(common->alloc_ctx); | ||
989 | return ret; | ||
990 | } | ||
986 | /* Set io allowed member of file handle to TRUE */ | 991 | /* Set io allowed member of file handle to TRUE */ |
987 | fh->io_allowed[index] = 1; | 992 | fh->io_allowed[index] = 1; |
988 | /* Increment io usrs member of channel object to 1 */ | 993 | /* Increment io usrs member of channel object to 1 */ |