diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-05-29 13:59:59 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-17 15:53:22 +0400 |
commit | b83007024219c0135aa18ca5e756b3935c3b8e31 (patch) | |
tree | 7058265decbdf976ae9df59227f5789925f2d207 | |
parent | 29d6a98b3381f5d94f56d4c0cd65a8cf7fb9419a (diff) | |
download | linux-b83007024219c0135aa18ca5e756b3935c3b8e31.tar.xz |
[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.c | 4 |
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 |