From 2600664a4e8d333290f01f0a957ea996e300bc6f Mon Sep 17 00:00:00 2001 From: Prasad J Pandit Date: Mon, 25 Jan 2016 19:59:50 +0530 Subject: [PATCH] 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 --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index f3797b7792..e64f69b591 100644 --- a/exec.c +++ b/exec.c @@ -1903,7 +1903,7 @@ static void invalidate_and_set_dirty(hwaddr addr, 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; -- 2.39.5