]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: rts5139: a couple off by one fixes
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 29 Mar 2012 18:52:20 +0000 (21:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Apr 2012 17:31:00 +0000 (10:31 -0700)
commit6f101c2507e5205ab03c0025a6e5d4f8a1c1cdcc
tree62a1d542026c618064a512d036a56e52a81354ee
parent705b300aec442d0b209fd22399ad37ebee92b5b4
Staging: rts5139: a couple off by one fixes

Inside the array we check ms_start_idx[seg_no + 1] so on the last round
through we end up going past the end of the array.

Also if we don't break out of the loop early then we are beyond the end
of the array there as well.  With this change, if we don't find what we
are looking for, we end on the last element of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5139/ms.c