diff --git a/security/security.c b/security/security.c index 2d24586c439b..2977b4d0ba15 100644 --- a/security/security.c +++ b/security/security.c @@ -109,6 +109,8 @@ static int lsm_append(char *new, char **result) if (*result == NULL) { *result = kstrdup(new, GFP_KERNEL); + if (*result == NULL) + return -ENOMEM; } else { /* Check if it is the last registered name */ if (match_last_lsm(*result, new))