mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
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>
This commit is contained in:
parent
e7432675f8
commit
8a57a9dda7
1 changed files with 2 additions and 1 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue