diff mbox series

[XEN,09/13] x86/mm: add defensive return

Message ID 282da9981826370ca839503477fb515af14ff4b5.1718892030.git.federico.serafini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series x86: address violations of MISRA C Rule 16.3 | expand

Commit Message

Federico Serafini June 20, 2024, 2:02 p.m. UTC
Add defensive return statement at the end of an unreachable
default case. Other than improve safety, this meets the requirements
to deviate a violation of MISRA C Rule 16.3.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/mm.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 648d6dd475..2e19ced15e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -916,6 +916,7 @@  get_page_from_l1e(
                 return 0;
             default:
                 ASSERT_UNREACHABLE();
+                return 0;
             }
         }
         else if ( l1f & _PAGE_RW )