summaryrefslogtreecommitdiff
path: root/drivers/media/platform/rcar_drif.c
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-10-18 07:47:00 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2019-11-05 14:56:24 +0300
commitd39083234c60519724c6ed59509a2129fd2aed41 (patch)
tree6218d97587571531ed30bd6573c35749660eb163 /drivers/media/platform/rcar_drif.c
parent60afcc06ad4129af6705c1b053a4275c94d97c50 (diff)
downloadlinux-d39083234c60519724c6ed59509a2129fd2aed41.tar.xz
media: rcar_drif: fix a memory disclosure
"f->fmt.sdr.reserved" is uninitialized. As other peer drivers like msi2500 and airspy do, the fix initializes it to avoid memory disclosures. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/rcar_drif.c')
-rw-r--r--drivers/media/platform/rcar_drif.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/platform/rcar_drif.c b/drivers/media/platform/rcar_drif.c
index 608e5217ccd5..0f267a237b42 100644
--- a/drivers/media/platform/rcar_drif.c
+++ b/drivers/media/platform/rcar_drif.c
@@ -912,6 +912,7 @@ static int rcar_drif_g_fmt_sdr_cap(struct file *file, void *priv,
{
struct rcar_drif_sdr *sdr = video_drvdata(file);
+ memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
f->fmt.sdr.pixelformat = sdr->fmt->pixelformat;
f->fmt.sdr.buffersize = sdr->fmt->buffersize;