page-xfer: use negative values for error codes

Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
Andrei Vagin 2022-04-27 06:59:02 +03:00
parent 51533d98ac
commit 0df0a7dace

View file

@ -736,7 +736,7 @@ static long fill_userbuf(int pid, struct page_pipe_buf *ppb, struct iovec *bufve
continue;
} else if (errno == ESRCH) {
pr_debug("Target process PID:%d not found\n", pid);
return ESRCH;
return -ESRCH;
}
}
@ -798,7 +798,7 @@ int page_xfer_predump_pages(int pid, struct page_xfer *xfer, struct page_pipe *p
bytes_read = fill_userbuf(pid, ppb, &bufvec, aux_iov, &aux_len);
if (bytes_read == ESRCH) {
if (bytes_read == -ESRCH) {
munmap(userbuf, BUFFER_SIZE);
return -1;
}