From: Jean Delvare Date: Wed, 22 Mar 2006 06:48:30 +0000 (-0300) Subject: V4L/DVB (3568f): saa7110: Fix array overrun X-Git-Tag: v2.6.17-rc1~996^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6201573cc9bfe1e0bdec229bed8e95b0dc88a587;p=linux-2.6 V4L/DVB (3568f): saa7110: Fix array overrun Fix a (probably harmless) array overrun in the DECODER_DUMP command of the saa7110 driver. No big deal as this command is not used anywhere anyway. Also reformat the dump so that it displays nicely. Signed-off-by: Jean Delvare Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index 7bb85a7b32..20cad9fc99 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c @@ -432,15 +432,13 @@ saa7110_command (struct i2c_client *client, break; case DECODER_DUMP: - for (v = 0; v < 0x34; v += 16) { + for (v = 0; v < SAA7110_NR_REG; v += 16) { int j; - dprintk(1, KERN_INFO "%s: %03x\n", I2C_NAME(client), + dprintk(1, KERN_DEBUG "%s: %02x:", I2C_NAME(client), v); - for (j = 0; j < 16; j++) { - dprintk(1, KERN_INFO " %02x", - decoder->reg[v + j]); - } - dprintk(1, KERN_INFO "\n"); + for (j = 0; j < 16 && v + j < SAA7110_NR_REG; j++) + dprintk(1, " %02x", decoder->reg[v + j]); + dprintk(1, "\n"); } break;