Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b80f12e authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab
Browse files

media: coda: ctx->codec is not NULL in coda_alloc_framebuffers



This fixes a smatch warning:

    drivers/media/platform/coda/coda-bit.c:415 coda_alloc_framebuffers()
    error: we previously assumed 'ctx->codec' could be null (see line 396)

coda_alloc_framebuffers() is called from coda_start_encoding() and
__coda_start_decoding(). Both dereference ctx->codec before calling
coda_alloc_framebuffers() in lines 935 and 1649, so ctx->codec can not
be NULL.

Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hansverk@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent be78b59e
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -393,8 +393,8 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx,
	int ret;
	int ret;
	int i;
	int i;


	if (ctx->codec && (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 ||
	if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 ||
	     ctx->codec->dst_fourcc == V4L2_PIX_FMT_H264)) {
	    ctx->codec->dst_fourcc == V4L2_PIX_FMT_H264) {
		width = round_up(q_data->width, 16);
		width = round_up(q_data->width, 16);
		height = round_up(q_data->height, 16);
		height = round_up(q_data->height, 16);
	} else {
	} else {