[PATCH] x86/altp2m: add missing break

Roger Pau Monne posted 1 patch 4 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200415110939.9481-1-roger.pau@citrix.com
xen/arch/x86/hvm/hvm.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] x86/altp2m: add missing break
Posted by Roger Pau Monne 4 years ago
Add a missing break in the HVMOP_altp2m_set_visibility case, or else
code flow will continue into the default case and trigger the assert.

Fixes: 3fd3e9303ec4b1 ('x86/altp2m: hypercall to set altp2m view visibility')
Coverity-ID: 1461759
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/hvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6f6f3f73a8..45959d3412 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4798,6 +4798,7 @@ static int do_altp2m_op(
         else
             rc = p2m_set_altp2m_view_visibility(d, idx,
                                                 a.u.set_visibility.visible);
+        break;
     }
 
     default:
-- 
2.26.0


Re: [PATCH] x86/altp2m: add missing break
Posted by Wei Liu 4 years ago
On Wed, Apr 15, 2020 at 01:09:39PM +0200, Roger Pau Monne wrote:
> Add a missing break in the HVMOP_altp2m_set_visibility case, or else
> code flow will continue into the default case and trigger the assert.
> 
> Fixes: 3fd3e9303ec4b1 ('x86/altp2m: hypercall to set altp2m view visibility')
> Coverity-ID: 1461759
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Wei Liu <wl@xen.org>