[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/mm: add defensive return



commit a8a74261681b5010a6f29e18b30739528c8f310c
Author:     Federico Serafini <federico.serafini@xxxxxxxxxxx>
AuthorDate: Mon Sep 2 11:55:16 2024 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Sep 2 11:55:16 2024 +0200

    x86/mm: add defensive return
    
    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: "An unconditional `break'
    statement shall terminate every switch-clause".
    
    Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/mm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e9c86208b0..4148c65657 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -918,6 +918,7 @@ get_page_from_l1e(
                 return 0;
             default:
                 ASSERT_UNREACHABLE();
+                return -EILSEQ;
             }
         }
         else if ( l1f & _PAGE_RW )
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.