Commit 8a57a9dd authored by Roel Kluin's avatar Roel Kluin Committed by Joel Becker

ocfs2: keep index within status_map[]

Do not exceed array status_map[]
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent e7432675
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* General Public License for more details. * General Public License for more details.
*/ */
#include <linux/kernel.h>
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -153,7 +154,7 @@ static int status_map[] = { ...@@ -153,7 +154,7 @@ static int status_map[] = {
static int dlm_status_to_errno(enum dlm_status status) static int dlm_status_to_errno(enum dlm_status status)
{ {
BUG_ON(status > (sizeof(status_map) / sizeof(status_map[0]))); BUG_ON(status < 0 || status >= ARRAY_SIZE(status_map));
return status_map[status]; return status_map[status];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment