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>
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;