1From 58e74682baf4e1ad26b064d8c02e5bc99c75c5d9 Mon Sep 17 00:00:00 2001 2From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@redhat.com> 3Date: Wed, 15 Dec 2021 19:24:20 +0100 4Subject: [PATCH] softmmu/physmem: Simplify flatview_write and 5 address_space_access_valid 6MIME-Version: 1.0 7Content-Type: text/plain; charset=utf8 8Content-Transfer-Encoding: 8bit 9 10Remove unuseful local 'result' variables. 11 12Reviewed-by: Peter Xu <peterx@redhat.com> 13Reviewed-by: David Hildenbrand <david@redhat.com> 14Reviewed-by: Alexander Bulekov <alxndr@bu.edu> 15Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> 16Signed-off-by: Philippe Mathieu-DaudÃf© <philmd@redhat.com> 17Message-Id: <20211215182421.418374-3-philmd@redhat.com> 18Signed-off-by: Thomas Huth <thuth@redhat.com> 19Signed-off-by: Virendra Thakur <virendra.thakur@kpit.com> 20 21CVE: CVE-2021-3750 22 23Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=58e74682baf4e1ad26b064d8c02e5bc99c75c5d9] 24--- 25 softmmu/physmem.c | 11 +++-------- 26 1 file changed, 3 insertions(+), 8 deletions(-) 27 28diff --git a/softmmu/physmem.c b/softmmu/physmem.c 29index 43ae70f..3d968ca 100644 30--- a/softmmu/physmem.c 31+++ b/softmmu/physmem.c 32@@ -2826,14 +2826,11 @@ static MemTxResult flatview_write(FlatVi 33 hwaddr l; 34 hwaddr addr1; 35 MemoryRegion *mr; 36- MemTxResult result = MEMTX_OK; 37 38 l = len; 39 mr = flatview_translate(fv, addr, &addr1, &l, true, attrs); 40- result = flatview_write_continue(fv, addr, attrs, buf, len, 41- addr1, l, mr); 42- 43- return result; 44+ return flatview_write_continue(fv, addr, attrs, buf, len, 45+ addr1, l, mr); 46 } 47 48 /* Called within RCU critical section. */ 49@@ -3130,12 +3127,10 @@ bool address_space_access_valid(AddressS 50 MemTxAttrs attrs) 51 { 52 FlatView *fv; 53- bool result; 54 55 RCU_READ_LOCK_GUARD(); 56 fv = address_space_to_flatview(as); 57- result = flatview_access_valid(fv, addr, len, is_write, attrs); 58- return result; 59+ return flatview_access_valid(fv, addr, len, is_write, attrs); 60 } 61 62 static hwaddr 63-- 641.8.3.1 65 66