mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Patch 09/35] media: ti-vpe: vpe: Return NULL for invalid buffer type
@ 2016-09-28 21:21 Benoit Parrot
  0 siblings, 0 replies; only message in thread
From: Benoit Parrot @ 2016-09-28 21:21 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, linux-kernel

From: Nikhil Devshatwar <nikhil.nd@ti.com>

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>
---
 drivers/media/platform/ti-vpe/vpe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index 2a4deceea17d..b66b55322dd4 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;
 }
-- 
2.9.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-28 21:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28 21:21 [Patch 09/35] media: ti-vpe: vpe: Return NULL for invalid buffer type Benoit Parrot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®