From e837d85c614e8d6e2d93daed972874ea3a8daec7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 Sep 2016 13:37:06 -0300 Subject: [media] cx23885: Fix some smatch warnings Make sure that it won't go past the config buffers drivers/media/pci/cx23885/cx23885-dvb.c:1733 dvb_register() warn: buffer overflow 'netup_xc5000_config' 2 <= s32max drivers/media/pci/cx23885/cx23885-dvb.c:1745 dvb_register() warn: buffer overflow 'netup_stv0367_config' 2 <= s32max drivers/media/pci/cx23885/cx23885-dvb.c:1752 dvb_register() warn: buffer overflow 'netup_xc5000_config' 2 <= s32max Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/cx23885/cx23885-dvb.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/media/pci/cx23885/cx23885-dvb.c') diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 828b54afd59e..818f3c2fc98d 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c @@ -1720,6 +1720,9 @@ static int dvb_register(struct cx23885_tsport *port) } break; case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: + if (port->nr > 2) + return 0; + i2c_bus = &dev->i2c_bus[0]; mfe_shared = 1;/* MFE */ port->frontends.gate = 0;/* not clear for me yet */ -- cgit v1.2.3