[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] exec: set map length to zero when returning NULL
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3] exec: set map length to zero when returning NULL |
Date: |
Tue, 26 May 2020 11:19:12 +0100 |
On Tue, 26 May 2020 at 08:53, P J P <address@hidden> wrote:
>
> From: Prasad J Pandit <address@hidden>
>
> When mapping physical memory into host's virtual address space,
> 'address_space_map' may return NULL if BounceBuffer is in_use.
> Set and return '*plen = 0' to avoid later NULL pointer dereference.
>
> Reported-by: Alexander Bulekov <address@hidden>
> Fixes: https://bugs.launchpad.net/qemu/+bug/1878259
> Signed-off-by: Prasad J Pandit <address@hidden>
The doc comment for this function in include/exec/memory.h
currently says
"May return %NULL if resources needed to perform the mapping
are exhausted."
If we're tightening the API to guarantee to also set *plen to 0
in this failure case it would be good to capture that in the
documentation, eg:
"May return %NULL (and set *@plen to 0) if resources needed
to perform the mapping are exhausted.)"
thanks
-- PMM