summaryrefslogtreecommitdiffstats
path: root/kernel/security/selinux/ss/ebitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/security/selinux/ss/ebitmap.c')
-rw-r--r--kernel/security/selinux/ss/ebitmap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/security/selinux/ss/ebitmap.c b/kernel/security/selinux/ss/ebitmap.c
index afe6a269e..57644b1dc 100644
--- a/kernel/security/selinux/ss/ebitmap.c
+++ b/kernel/security/selinux/ss/ebitmap.c
@@ -153,6 +153,12 @@ int ebitmap_netlbl_import(struct ebitmap *ebmap,
if (offset == (u32)-1)
return 0;
+ /* don't waste ebitmap space if the netlabel bitmap is empty */
+ if (bitmap == 0) {
+ offset += EBITMAP_UNIT_SIZE;
+ continue;
+ }
+
if (e_iter == NULL ||
offset >= e_iter->startbit + EBITMAP_SIZE) {
e_prev = e_iter;