* [patch] [media] av7110_hw: fix a sanity check in av7110_fw_cmd()
@ 2014-03-01 13:51 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2014-03-01 13:51 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Hans Verkuil, linux-media, kernel-janitors
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>
diff --git a/drivers/media/pci/ttpci/av7110_hw.c b/drivers/media/pci/ttpci/av7110_hw.c
index 6299d5dadb82..300bd3c94738 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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-03-01 13:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-01 13:51 [patch] [media] av7110_hw: fix a sanity check in av7110_fw_cmd() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).