From d72d7c1df98628315298102dd1d442bcf24dc44c Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 17 Mar 2010 12:11:56 -0300 Subject: [PATCH] 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 Reviewed-by: Andy Walls Signed-off-by: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ivtv/ivtv-vbi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.20.1