On Tue, 26 May 2020 at 08:53, P J P <[email protected]> wrote:
>
> From: Prasad J Pandit <[email protected]>
>
> 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 <[email protected]>
> Fixes: https://bugs.launchpad.net/qemu/+bug/1878259
> Signed-off-by: Prasad J Pandit <[email protected]>

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

Reply via email to