Skip to content

Commit

Permalink
[media] cx23885: Fix some smatch warnings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mauro Carvalho Chehab committed Sep 22, 2016
1 parent e3ea5e9 commit e837d85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/media/pci/cx23885/cx23885-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx23885/cx23885.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ struct cx23885_dmaqueue {
struct cx23885_tsport {
struct cx23885_dev *dev;

int nr;
unsigned nr;
int sram_chno;

struct vb2_dvb_frontends frontends;
Expand Down

0 comments on commit e837d85

Please sign in to comment.