Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "staging: tidspbridge: use safer test on the result of find_first_zero_bit"

This reverts commit cc0be81f00472d782804293766ddd9d1c2b4ebd1, it was
incorrect.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+2 -2
+2 -2
drivers/staging/tidspbridge/rmgr/node.c
··· 935 935 node2_type == NODE_DAISSOCKET)) { 936 936 /* Find available pipe */ 937 937 pipe_id = find_first_zero_bit(hnode_mgr->pipe_map, MAXPIPES); 938 - if (pipe_id >= MAXPIPES) { 938 + if (pipe_id == MAXPIPES) { 939 939 status = -ECONNREFUSED; 940 940 goto out_unlock; 941 941 } ··· 1008 1008 status = -EINVAL; 1009 1009 goto out_unlock; 1010 1010 } 1011 - if (chnl_id >= CHNL_MAXCHANNELS) { 1011 + if (chnl_id == CHNL_MAXCHANNELS) { 1012 1012 status = -ECONNREFUSED; 1013 1013 goto out_unlock; 1014 1014 }