Skip to content

Commit 8a57a9d

Browse files
RoelKluinJoel Becker
authored andcommitted
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>
1 parent e743267 commit 8a57a9d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎fs/ocfs2/stack_o2cb.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* General Public License for more details.
1818
*/
1919

20+
#include <linux/kernel.h>
2021
#include <linux/crc32.h>
2122
#include <linux/module.h>
2223

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

154155
static int dlm_status_to_errno(enum dlm_status status)
155156
{
156-
BUG_ON(status > (sizeof(status_map) / sizeof(status_map[0])));
157+
BUG_ON(status < 0 || status >= ARRAY_SIZE(status_map));
157158

158159
return status_map[status];
159160
}

0 commit comments

Comments
 (0)