From: Vladimir Yakovlev <vovchkir@xxxxxxxxx> No need to print BUG() report when received wrong format in coda_try_fmt. It's enough to print log and return an error. Co-developed-by: Sergey Khimich <serghox@xxxxxxxxx> Signed-off-by: Sergey Khimich <serghox@xxxxxxxxx> Signed-off-by: Vladimir Yakovlev <vovchkir@xxxxxxxxx> --- drivers/media/platform/chips-media/coda/coda-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index 29b01ade8829..9b443ddabeab 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -644,7 +644,9 @@ static int coda_try_fmt(struct coda_ctx *ctx, const struct coda_codec *codec, f->fmt.pix.height); break; default: - BUG(); + v4l2_warn(&dev->v4l2_dev, "Warning: wrong format=0x%04X", + f->fmt.pix.pixelformat); + return -EINVAL; } return 0; -- 2.30.2