qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/3] megasas: avoid NULL pointer dereference


From: Paolo Bonzini
Subject: Re: [PATCH v2 2/3] megasas: avoid NULL pointer dereference
Date: Tue, 26 May 2020 09:49:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

On 26/05/20 09:18, P J P wrote:
> Later when address_space_map() returns 'NULL' above, '*plen' is not set to 
> zero.
> 
> diff --git a/exec.c b/exec.c
> index 5162f0d12f..4eea84bf66 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3538,6 +3538,7 @@ void *address_space_map(AddressSpace *as,
>  
>      if (!memory_access_is_direct(mr, is_write)) {
>          if (atomic_xchg(&bounce.in_use, true)) {
> +            *plen = 0;
>              return NULL;
>          }
> 
> I'll send a revised patch above.

Great, this looks good.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]