Re: [PATCH 2/3] xen/privcmd: fix error handling in mmap-resource processing

From: Boris Ostrovsky
Date: Wed Sep 22 2021 - 09:29:40 EST



On 9/22/21 6:17 AM, Jan Beulich wrote:
> @@ -817,7 +818,7 @@ static long privcmd_ioctl_mmap_resource(
> unsigned int i;
>
> for (i = 0; i < num; i++) {
> - rc = pfns[i];
> + rc = errs[i];
> if (rc < 0)
> break;


Can the assignment be moved inside the 'if' statement?


I am also not sure I understand why we need error array at all. Don't we always look at the first error only? In fact, AFAICS this is the only place where we look at the value.


-boris