summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-17 16:11:56 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-18 05:50:26 +0200
commitd72d7c1df98628315298102dd1d442bcf24dc44c (patch)
tree2e64c508150b5af33876c9ce002f40bd2cbaf8f5 /drivers/media/video/ivtv
parentV4L/DVB: v4l: videobuf: code cleanup (diff)
downloadlinux-d72d7c1df98628315298102dd1d442bcf24dc44c.tar.xz
linux-d72d7c1df98628315298102dd1d442bcf24dc44c.zip
V4L/DVB: ivtv: sizeof() => ARRAY_SIZE()
This fixes a smatch warning: drivers/media/video/ivtv/ivtv-vbi.c +138 ivtv_write_vbi(43) error: buffer overflow 'vi->cc_payload' 256 <= 1023 Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Andy Walls <awalls@radix.net> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv')
-rw-r--r--drivers/media/video/ivtv/ivtv-vbi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-vbi.c b/drivers/media/video/ivtv/ivtv-vbi.c
index f420d31b937d..d73af45dede6 100644
--- a/drivers/media/video/ivtv/ivtv-vbi.c
+++ b/drivers/media/video/ivtv/ivtv-vbi.c
@@ -134,7 +134,7 @@ void ivtv_write_vbi(struct ivtv *itv, const struct v4l2_sliced_vbi_data *sliced,
}
}
}
- if (found_cc && vi->cc_payload_idx < sizeof(vi->cc_payload)) {
+ if (found_cc && vi->cc_payload_idx < ARRAY_SIZE(vi->cc_payload)) {
vi->cc_payload[vi->cc_payload_idx++] = cc;
set_bit(IVTV_F_I_UPDATE_CC, &itv->i_flags);
}