mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
apparmor: get_suspend_policy must return NULL in error cases
Before this fix, it could return MAP_FAILED which is ((void *) -1). Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
71999d8883
commit
ac22aaf576
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue