From: Hans Verkuil Date: Wed, 29 May 2013 09:59:59 +0000 (-0300) Subject: [media] saa7134: check register address in g_register X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b83007024219c0135aa18ca5e756b3935c3b8e31;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] saa7134: check register address in g_register Prevent reading out-of-range register values. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 737e643be27a..db4cc1c54aa6 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c @@ -2258,7 +2258,7 @@ static int vidioc_g_register (struct file *file, void *priv, struct saa7134_fh *fh = priv; struct saa7134_dev *dev = fh->dev; - reg->val = saa_readb(reg->reg); + reg->val = saa_readb(reg->reg & 0xffffff); reg->size = 1; return 0; } @@ -2269,7 +2269,7 @@ static int vidioc_s_register (struct file *file, void *priv, struct saa7134_fh *fh = priv; struct saa7134_dev *dev = fh->dev; - saa_writeb(reg->reg&0xffffff, reg->val); + saa_writeb(reg->reg & 0xffffff, reg->val); return 0; } #endif