Merge branch 'for-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
[firefly-linux-kernel-4.4.55.git] / drivers / staging / comedi / drivers / comedi_bond.c
index 96db0c2686a1e6971478ee74c23412049fb654cf..50b76eccb7d708cfc112e523f0d633440264a031 100644 (file)
@@ -101,7 +101,8 @@ static int bonding_dio_insn_bits(struct comedi_device *dev,
                        b_chans = bdev->nchans - base_chan;
                        if (b_chans > n_left)
                                b_chans = n_left;
-                       b_mask = (1U << b_chans) - 1;
+                       b_mask = (b_chans < 32) ? ((1 << b_chans) - 1)
+                                               : 0xffffffff;
                        b_write_mask = (write_mask >> n_done) & b_mask;
                        b_data_bits = (data_bits >> n_done) & b_mask;
                        /* Read/Write the new digital lines. */