Skip to content

Commit

Permalink
ocfs2: keep index within status_map[]
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Joel Becker committed Aug 7, 2009
1 parent e743267 commit 8a57a9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ocfs2/stack_o2cb.c
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
* General Public License for more details.
*/

#include <linux/kernel.h>
#include <linux/crc32.h>
#include <linux/module.h>

@@ -153,7 +154,7 @@ static int status_map[] = {

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];
}

0 comments on commit 8a57a9d

Please sign in to comment.