diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2017-06-08 06:21:13 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-24 09:35:35 -0300 |
commit | 9b80f12e319198cef65076654ccaa4b2783a2fa1 (patch) | |
tree | b316ebf43ceaa4c420cab63e1dc4ce9a4df1e1bf /drivers/media/platform/coda | |
parent | be78b59e4806337b447a07a5042f4ef84b047c1a (diff) | |
download | linux-9b80f12e319198cef65076654ccaa4b2783a2fa1.tar.bz2 |
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: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/coda')
-rw-r--r-- | drivers/media/platform/coda/coda-bit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 25cbf9e5ac5a..8d0211fd4fd0 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -393,8 +393,8 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx, int ret; int i; - if (ctx->codec && (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 || - ctx->codec->dst_fourcc == V4L2_PIX_FMT_H264)) { + if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 || + ctx->codec->dst_fourcc == V4L2_PIX_FMT_H264) { width = round_up(q_data->width, 16); height = round_up(q_data->height, 16); } else { |