summaryrefslogtreecommitdiff
path: root/drivers/media/pci/cx88
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-05-29 06:22:02 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 10:48:18 -0300
commit7feeb1482153575bc9221eff098e9a1313522dfe (patch)
tree95cd879ae355ad10c3cae73a72e157298e8318f8 /drivers/media/pci/cx88
parentda6a855320a6e056add76ea0503b01efdbb0de36 (diff)
[media] cx88: fix register mask
Ensure that the register is aligned to a dword, otherwise the read could read out-of-range data. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r--drivers/media/pci/cx88/cx88-video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index 5b26ece4aea5..ecf21d9f1f34 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1360,7 +1360,7 @@ static int vidioc_g_register (struct file *file, void *fh,
struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
/* cx2388x has a 24-bit register space */
- reg->val = cx_read(reg->reg & 0xffffff);
+ reg->val = cx_read(reg->reg & 0xfffffc);
reg->size = 4;
return 0;
}
@@ -1370,7 +1370,7 @@ static int vidioc_s_register (struct file *file, void *fh,
{
struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
- cx_write(reg->reg & 0xffffff, reg->val);
+ cx_write(reg->reg & 0xfffffc, reg->val);
return 0;
}
#endif