diff options
Diffstat (limited to 'security/selinux/ss/ebitmap.c')
-rw-r--r-- | security/selinux/ss/ebitmap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c index afe6a269ec17..57644b1dc42e 100644 --- a/security/selinux/ss/ebitmap.c +++ b/security/selinux/ss/ebitmap.c | |||
@@ -153,6 +153,12 @@ int ebitmap_netlbl_import(struct ebitmap *ebmap, | |||
153 | if (offset == (u32)-1) | 153 | if (offset == (u32)-1) |
154 | return 0; | 154 | return 0; |
155 | 155 | ||
156 | /* don't waste ebitmap space if the netlabel bitmap is empty */ | ||
157 | if (bitmap == 0) { | ||
158 | offset += EBITMAP_UNIT_SIZE; | ||
159 | continue; | ||
160 | } | ||
161 | |||
156 | if (e_iter == NULL || | 162 | if (e_iter == NULL || |
157 | offset >= e_iter->startbit + EBITMAP_SIZE) { | 163 | offset >= e_iter->startbit + EBITMAP_SIZE) { |
158 | e_prev = e_iter; | 164 | e_prev = e_iter; |