summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/ti-vpe/vpe.c
diff options
context:
space:
mode:
authorNikhil Devshatwar2016-11-19 00:20:19 +0100
committerMauro Carvalho Chehab2016-11-22 10:03:34 +0100
commit072915b57a85e8d65e22be5595a639110afdcc90 (patch)
tree154e9284473dea3c3928f553b574c2e7988f77df /drivers/media/platform/ti-vpe/vpe.c
parent[media] media: ti-vpe: Increasing max buffer height and width (diff)
downloadkernel-qcow2-linux-072915b57a85e8d65e22be5595a639110afdcc90.tar.gz
kernel-qcow2-linux-072915b57a85e8d65e22be5595a639110afdcc90.tar.xz
kernel-qcow2-linux-072915b57a85e8d65e22be5595a639110afdcc90.zip
[media] media: ti-vpe: vpe: Return NULL for invalid buffer type
get_q_data can be called with different values for type e.g. vpe_try_crop calls it with the buffer type which gets passed from user space Framework doesn't check wheather its correct type or not If user space passes wrong type, kernel should not crash. Return NULL when the passed type is invalid. Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com> Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/ti-vpe/vpe.c')
-rw-r--r--drivers/media/platform/ti-vpe/vpe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index c624f5db7f08..4b6e8839dd83 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -420,7 +420,7 @@ static struct vpe_q_data *get_q_data(struct vpe_ctx *ctx,
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
return &ctx->q_data[Q_DATA_DST];
default:
- BUG();
+ return NULL;
}
return NULL;
}