From c601ccc9b98a3f735493faf8487dbfa59ec4e0c6 Mon Sep 17 00:00:00 2001 From: Benjamin Gaignard Date: Wed, 12 Apr 2023 18:38:29 +0200 Subject: [PATCH] media: verisilicon: Fix crash when probing encoder ctx->vpu_dst_fmt is no more initialized before calling hantro_try_fmt() This led to crash the kernel. Signed-off-by: Benjamin Gaignard Fixes: db6f68b51e5c ("media: verisilicon: Do not set context src/dst formats in reset functions") --- drivers/media/platform/verisilicon/hantro_v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c index 8f1414085f47..e8bcb6d669fc 100644 --- a/drivers/media/platform/verisilicon/hantro_v4l2.c +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c @@ -297,7 +297,7 @@ static int hantro_try_fmt(const struct hantro_ctx *ctx, pix_mp->num_planes = 1; vpu_fmt = fmt; } else if (ctx->is_encoder) { - vpu_fmt = ctx->vpu_dst_fmt; + vpu_fmt = fmt; } else { vpu_fmt = fmt; /* -- 2.34.1