From: Prasad J Pandit Date: Mon, 25 Jan 2016 14:29:50 +0000 (+0530) Subject: exec: fix a glitch in checking dma r/w access X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9a5a7327425fb18a210728f397df4fbc577019c7;p=qemu-upstream-4.5-testing.git exec: fix a glitch in checking dma r/w access While checking r/w access in 'memory_access_is_direct' routine a glitch in the expression leads to segmentation fault while performing dma read operation. Reported-by: Donghai Zdh Signed-off-by: Prasad J Pandit --- diff --git a/exec.c b/exec.c index cf120496f..e739bed77 100644 --- a/exec.c +++ b/exec.c @@ -342,7 +342,7 @@ address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *x static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write) { if (memory_region_is_ram(mr)) { - return !(is_write && mr->readonly); + return (is_write && !mr->readonly); } if (memory_region_is_romd(mr)) { return !is_write;