staging: comedi: comedi_bond: fix 'b_mask' calc in bonding_dio_insn_bits()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 20 Apr 2015 18:49:04 +0000 (11:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 15:15:59 +0000 (17:15 +0200)
commitb3ab6fbfd8625232c54d70e29f7274118726ba45
tree0fba04198fc5c44d0005a8a7ee4129a75151f06c
parent351f6689cc2941f4e1ec588b8b4673457acf2e58
staging: comedi: comedi_bond: fix 'b_mask' calc in bonding_dio_insn_bits()

'b_chans' may be a valud up to 32. 'b_mask' is an unsigned int and a left shift of
more than 31 bits has undefined behavior. Fix the calc so it works correctly with
a 'b_chans' of 32..

Reported-by: coverity (CID 1192244)
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>
drivers/staging/comedi/drivers/comedi_bond.c