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

[xen staging] xsm/flask: missing breaks, MISRA rule 16.4



commit 4a06cc7178ad8914dc2a0dc86282662af15041e1
Author:     Denis Mukhin <dmukhin@xxxxxxxx>
AuthorDate: Tue Nov 26 15:21:52 2024 -0800
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Nov 27 14:49:58 2024 +0000

    xsm/flask: missing breaks, MISRA rule 16.4
    
    While working on console forwarding for virtual NS8250 I stepped into
      flask_domain_alloc_security()
    where break statement was missing in default case which violates MISRA
    rule 16.4.
    
    Fixed everywhere in hooks.c.
    
    Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
    Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
 xen/xsm/flask/hooks.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index dfa23738cd..a79474ffe4 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -198,6 +198,7 @@ static int cf_check flask_domain_alloc_security(struct 
domain *d)
             else if ( pv_shim )
                 dsec->sid = SECINITSID_DOMU;
         }
+        break;
     }
 
     dsec->self_sid = dsec->sid;
@@ -342,6 +343,7 @@ static int cf_check flask_evtchn_send(struct domain *d, 
struct evtchn *chn)
         break;
     default:
         rc = avc_unknown_permission("event channel state", chn->state);
+        break;
     }
 
     return rc;
@@ -1310,6 +1312,7 @@ static int cf_check flask_hvm_param(struct domain *d, 
unsigned long op)
         break;
     default:
         perm = HVM__HVMCTL;
+        break;
     }
 
     return current_has_perm(d, SECCLASS_HVM, perm);
@@ -2013,6 +2016,7 @@ const struct xsm_ops *__init flask_init(
     case FLASK_BOOTPARAM_INVALID:
     default:
         panic("Flask: Invalid value for flask= boot parameter.\n");
+        break;
     }
 
     avc_init();
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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