From: Hans Verkuil Date: Wed, 29 May 2013 10:00:10 +0000 (-0300) Subject: upstream: [media] ivtv: fix register range check X-Git-Tag: submit/tizen/20141121.110247~2207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86cf807bb61c269ebbbc843c03549e024b157a90;p=platform%2Fkernel%2Flinux-3.10.git upstream: [media] ivtv: 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 Cc: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 944300f..807b275 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -696,6 +696,8 @@ static int ivtv_itvc(struct ivtv *itv, bool get, u64 reg, u64 *val) { volatile u8 __iomem *reg_start; + if (reg & 0x3) + return -EINVAL; if (reg >= IVTV_REG_OFFSET && reg < IVTV_REG_OFFSET + IVTV_REG_SIZE) reg_start = itv->reg_mem - IVTV_REG_OFFSET; else if (itv->has_cx23415 && reg >= IVTV_DECODER_OFFSET &&