summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-05-29 06:59:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-17 08:53:22 -0300
commitb83007024219c0135aa18ca5e756b3935c3b8e31 (patch)
tree7058265decbdf976ae9df59227f5789925f2d207
parent29d6a98b3381f5d94f56d4c0cd65a8cf7fb9419a (diff)
downloadlinux-b83007024219c0135aa18ca5e756b3935c3b8e31.tar.bz2
[media] saa7134: check register address in g_register
Prevent reading out-of-range register values. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/pci/saa7134/saa7134-video.c4
1 files changed, 2 insertions, 2 deletions
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