[Devel] [PATCH RHEL COMMIT] ve/net: Fix warning about possible fall through in switch

Konstantin Khorenko khorenko at virtuozzo.com
Tue Sep 28 15:51:09 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after ark-5.14
------>
commit 54f863fb0712af49639ab59722456fd89326017f
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Tue Sep 28 15:28:23 2021 +0300

    ve/net: Fix warning about possible fall through in switch
    
    Fixes: a9514d1ba5a6 ("ve/net: introduce vz_security_*_check checks")
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/ve/ve.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 2f0eff24156a..0d4ce249d1c2 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -153,13 +153,13 @@ int vz_security_family_check(struct net *net, int family, int type)
 	case PF_KEY:
 		return 0;
 	case PF_BRIDGE:
-		if (type)
-			switch (type) {
-				case RTM_NEWNEIGH:
-				case RTM_DELNEIGH:
-				case RTM_GETNEIGH:
-					return 0;
-			}
+		switch (type) {
+			case RTM_NEWNEIGH:
+			case RTM_DELNEIGH:
+			case RTM_GETNEIGH:
+				return 0;
+		}
+		fallthrough;
 	default:
 		return -EAFNOSUPPORT;
 	}


More information about the Devel mailing list