From: Hans Verkuil Date: Wed, 29 May 2013 09:22:02 +0000 (-0300) Subject: [media] cx88: fix register mask X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7feeb1482153575bc9221eff098e9a1313522dfe;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 Cc: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- 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