From: Dan Carpenter Date: Sat, 1 Mar 2014 13:51:36 +0000 (-0300) Subject: upstream: [media] av7110_hw: fix a sanity check in av7110_fw_cmd() X-Git-Tag: submit/tizen/20141121.110247~1349 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=611001504aae39f08eb4cca9bc8b6fc106b552e7;p=platform%2Fkernel%2Flinux-3.10.git upstream: [media] av7110_hw: fix a sanity check in av7110_fw_cmd() ARRAY_SIZE(buf) (8 elements) was intended instead of sizeof(buf) (16 bytes). But this is just a sanity check and the callers always pass valid values so this doesn't cause a problem. Signed-off-by: Dan Carpenter Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/ttpci/av7110_hw.c b/drivers/media/pci/ttpci/av7110_hw.c index 6299d5d..300bd3c 100644 --- a/drivers/media/pci/ttpci/av7110_hw.c +++ b/drivers/media/pci/ttpci/av7110_hw.c @@ -501,7 +501,7 @@ int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...) // dprintk(4, "%p\n", av7110); - if (2 + num > sizeof(buf)) { + if (2 + num > ARRAY_SIZE(buf)) { printk(KERN_WARNING "%s: %s len=%d is too big!\n", KBUILD_MODNAME, __func__, num);