aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-22 12:37:06 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-22 12:37:06 -0400
commite837d85c614e8d6e2d93daed972874ea3a8daec7 (patch)
tree6f33d64cc45ad8ee0a1ea469de2f029946a114d7
parente3ea5e94489bc8c711d422dfa311cfa310553a1b (diff)
[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 <mchehab@s-opensource.com>
-rw-r--r--drivers/media/pci/cx23885/cx23885-dvb.c3
-rw-r--r--drivers/media/pci/cx23885/cx23885.h2
2 files changed, 4 insertions, 1 deletions
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)
1720 } 1720 }
1721 break; 1721 break;
1722 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: 1722 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF:
1723 if (port->nr > 2)
1724 return 0;
1725
1723 i2c_bus = &dev->i2c_bus[0]; 1726 i2c_bus = &dev->i2c_bus[0];
1724 mfe_shared = 1;/* MFE */ 1727 mfe_shared = 1;/* MFE */
1725 port->frontends.gate = 0;/* not clear for me yet */ 1728 port->frontends.gate = 0;/* not clear for me yet */
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h
index 2ebece93d111..a6735afe2269 100644
--- a/drivers/media/pci/cx23885/cx23885.h
+++ b/drivers/media/pci/cx23885/cx23885.h
@@ -257,7 +257,7 @@ struct cx23885_dmaqueue {
257struct cx23885_tsport { 257struct cx23885_tsport {
258 struct cx23885_dev *dev; 258 struct cx23885_dev *dev;
259 259
260 int nr; 260 unsigned nr;
261 int sram_chno; 261 int sram_chno;
262 262
263 struct vb2_dvb_frontends frontends; 263 struct vb2_dvb_frontends frontends;