Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 341e0cb5 authored by Janak Desai's avatar Janak Desai Committed by Paul Moore
Browse files

netlabel: fix a problem with netlbl_secattr_catmap_setrng()



We try to be clever and set large chunks of the bitmap at once, when
possible; unfortunately we weren't very clever when we wrote the code
and messed up the if-conditional.  Fix this bug and restore proper
operation.

Signed-off-by: default avatarJanak Desai <Janak.Desai@gtri.gatech.edu>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 9735a227
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -677,7 +677,7 @@ int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap,
	u32 spot = start;

	while (rc == 0 && spot <= end) {
		if (((spot & (BITS_PER_LONG - 1)) != 0) &&
		if (((spot & (BITS_PER_LONG - 1)) == 0) &&
		    ((end - spot) > BITS_PER_LONG)) {
			rc = netlbl_catmap_setlong(catmap,
						   spot,