Skip to content

Commit

Permalink
apparmor: get_suspend_policy must return NULL in error cases
Browse files Browse the repository at this point in the history
Before this fix, it could return MAP_FAILED which is ((void *) -1).

Signed-off-by: Andrei Vagin <[email protected]>
  • Loading branch information
avagin authored and rst0git committed Jul 3, 2024
1 parent c2f101a commit c6c83f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions criu/apparmor.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ static void *get_suspend_policy(char *name, off_t *len)
ret = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (ret == MAP_FAILED) {
pr_perror("mmap of %s failed", file);
ret = NULL;
goto out;
}

Expand Down

0 comments on commit c6c83f1

Please sign in to comment.