media: Don't let tvp5150_get_vbi() go out of vbi_ram_default array
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 19 Feb 2018 18:23:39 +0000 (13:23 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:55 +0000 (16:17 +0200)
commitcc4b4af51c13c0aec5c0368986295eb9dcfcdab1
tree36e6cea88195b8f28669b74b7ebb26452a140fbe
parent07999bccf2e01312bc299c60aca1b18ba83626be
media: Don't let tvp5150_get_vbi() go out of vbi_ram_default array

[ Upstream commit 3dd6b560dc5d59e7cb6dbda6e85dc9af7925fcf8 ]

As pointed by Dan, possible values for bits[3:0] of te Line Mode Registers
can range from 0x0 to 0xf, but the check logic allow values ranging
from 0x0 to 0xe.

As static arrays are initialized with zero, using a value without
an explicit initializer at the array won't cause any harm.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/i2c/tvp5150.c