ocfs2: keep index within status_map[]

Do not exceed array status_map[]

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Joel Becker <joel.becker@oracle.com>

authored by Roel Kluin and committed by Joel Becker 8a57a9dd e7432675

+2 -1
+2 -1
fs/ocfs2/stack_o2cb.c
··· 17 17 * General Public License for more details. 18 18 */ 19 19 20 + #include <linux/kernel.h> 20 21 #include <linux/crc32.h> 21 22 #include <linux/module.h> 22 23 ··· 154 153 155 154 static int dlm_status_to_errno(enum dlm_status status) 156 155 { 157 - BUG_ON(status > (sizeof(status_map) / sizeof(status_map[0]))); 156 + BUG_ON(status < 0 || status >= ARRAY_SIZE(status_map)); 158 157 159 158 return status_map[status]; 160 159 }