[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220620075253.GE16517@kadam>
Date: Mon, 20 Jun 2022 10:52:53 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Zhang Zekun <zhangzekun11@...wei.com>
Cc: ezequiel@...guardiasur.com.ar, mchehab@...nel.org,
gregkh@...uxfoundation.org, andrzej.p@...labora.com,
hverkuil-cisco@...all.nl, linux-media@...r.kernel.org,
linux-rockchip@...ts.infradead.org, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] media: rkvdec: Fix memset size error
On Fri, Jun 17, 2022 at 07:31:01AM +0000, Zhang Zekun wrote:
> 'dma_alloc_coherent()' alloc a 'RKVDEC_VP9_COUNT_SIZE' size area to
> 'unsigned char *count_tbl', however, the memset() bellow only set
> 'sizeof(*count_tbl)', which equals to 1, bytes to zero. This can
> cause unexpected error.
>
> Fixes: f25709c4ff15 ("media: rkvdec: Add the VP9 backend")
> Signed-off-by: Zhang Zekun <zhangzekun11@...wei.com>
> ---
> drivers/staging/media/rkvdec/rkvdec-vp9.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/rkvdec/rkvdec-vp9.c b/drivers/staging/media/rkvdec/rkvdec-vp9.c
> index 311a12656072..3ad303a3de48 100644
> --- a/drivers/staging/media/rkvdec/rkvdec-vp9.c
> +++ b/drivers/staging/media/rkvdec/rkvdec-vp9.c
> @@ -1026,7 +1026,7 @@ static int rkvdec_vp9_start(struct rkvdec_ctx *ctx)
>
> vp9_ctx->count_tbl.size = RKVDEC_VP9_COUNT_SIZE;
> vp9_ctx->count_tbl.cpu = count_tbl;
> - memset(count_tbl, 0, sizeof(*count_tbl));
> + memset(count_tbl, 0, RKVDEC_VP9_COUNT_SIZE);
Just delete the memset instead like Robin said. No Fixes tag required
on this one.
regards,
dan carpenter
Powered by blists - more mailing lists