diff mbox series

[02/36] xsm/flask: missing breaks, MISRA rule 16.4

Message ID 20241126-vuart-ns8250-v1-v1-2-87b9a8375b7a@ford.com (mailing list archive)
State New
Headers show
Series Introduce NS8250 UART emulator | expand

Commit Message

Denis Mukhin via B4 Relay Nov. 26, 2024, 11:21 p.m. UTC
From: Denis Mukhin <dmukhin@ford.com>

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@ford.com>
---
 xen/xsm/flask/hooks.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index dfa23738cd8a9fd91eda23d9c328c3cc55d31418..a79474ffe43af19f602a6c067eab6b40dba0d946 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();