mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-13 00:26:41 +07:00
staging: comedi: vmk80xx: sanity check context used to get the boardinfo
As done in all the comedi drivers that auto attach, sanity check the passed context that is used to get the boardinfo. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
adda9ab042
commit
e38576ce73
@ -795,7 +795,10 @@ static int vmk80xx_auto_attach(struct comedi_device *dev,
|
||||
struct vmk80xx_private *devpriv;
|
||||
int ret;
|
||||
|
||||
board = &vmk80xx_boardinfo[context];
|
||||
if (context < ARRAY_SIZE(vmk80xx_boardinfo))
|
||||
board = &vmk80xx_boardinfo[context];
|
||||
if (!board)
|
||||
return -ENODEV;
|
||||
dev->board_ptr = board;
|
||||
dev->board_name = board->name;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user