Commit b8300702 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] saa7134: check register address in g_register

Prevent reading out-of-range register values.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 29d6a98b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment