[media] av7110_hw: fix a sanity check in av7110_fw_cmd()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 1 Mar 2014 13:51:36 +0000 (10:51 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 11 Mar 2014 18:54:49 +0000 (15:54 -0300)
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 <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/pci/ttpci/av7110_hw.c

index 6299d5dadb822758bc4a2d9c1bb8a922bdfcd193..300bd3c9473876fb7b2751da7ab91532397621c2 100644 (file)
@@ -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);