diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-05-29 14:00:08 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-17 16:15:43 +0400 |
commit | 771d77339b0f7a236d1fc0ef414469b4282b47a9 (patch) | |
tree | 2e2adb10aa7b3a8b5cb8a277967678733a88cef9 /drivers/media/pci/cx18 | |
parent | 15c4fee344eb0b8a4d13a351220e337f2e929779 (diff) | |
download | linux-771d77339b0f7a236d1fc0ef414469b4282b47a9.tar.xz |
[media] cx18: fix register range check
Ensure that the register is aligned to a dword, otherwise the range check
could fail since it assumes dword alignment.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci/cx18')
-rw-r--r-- | drivers/media/pci/cx18/cx18-ioctl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c index 414b0ecccc91..1110bcb14e2f 100644 --- a/drivers/media/pci/cx18/cx18-ioctl.c +++ b/drivers/media/pci/cx18/cx18-ioctl.c @@ -367,6 +367,8 @@ static int cx18_g_register(struct file *file, void *fh, { struct cx18 *cx = fh2id(fh)->cx; + if (reg->reg & 0x3) + return -EINVAL; if (reg->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE) return -EINVAL; reg->size = 4; @@ -379,6 +381,8 @@ static int cx18_s_register(struct file *file, void *fh, { struct cx18 *cx = fh2id(fh)->cx; + if (reg->reg & 0x3) + return -EINVAL; if (reg->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE) return -EINVAL; cx18_write_enc(cx, reg->val, reg->reg); |