projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e743267
)
ocfs2: keep index within status_map[]
author
Roel Kluin
<
[email protected]
>
Thu, 6 Aug 2009 23:07:50 +0000
(16:07 -0700)
committer
Joel Becker
<
[email protected]
>
Fri, 7 Aug 2009 20:16:50 +0000
(13:16 -0700)
Do not exceed array status_map[]
Signed-off-by: Roel Kluin <
[email protected]
>
Cc: Mark Fasheh <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Joel Becker <
[email protected]
>
fs/ocfs2/stack_o2cb.c
patch
|
blob
|
history
diff --git
a/fs/ocfs2/stack_o2cb.c
b/fs/ocfs2/stack_o2cb.c
index 3f661376a2ded76e08769f1766de3c1523d448d9..e49c41050264dfa9d36afc48e742b626ee9d2755 100644
(file)
--- a/
fs/ocfs2/stack_o2cb.c
+++ b/
fs/ocfs2/stack_o2cb.c
@@
-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];
}