Skip to content

Commit

Permalink
[media] cx88: fix register mask
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jun 21, 2013
1 parent da6a855 commit 7feeb14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/pci/cx88/cx88-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit 7feeb14

Please sign in to comment.