]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - security/selinux/ss/ebitmap.c
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/drzeus/mmc
[linux-2.6-omap-h63xx.git] / security / selinux / ss / ebitmap.c
index cfed1d30fa6ad7af8e8aae11810bf58ba61dc27a..d539346ab3a2b5143f1d2232239ee8bdc217e4c8 100644 (file)
@@ -93,11 +93,15 @@ int ebitmap_export(const struct ebitmap *src,
        size_t bitmap_byte;
        unsigned char bitmask;
 
+       if (src->highbit == 0) {
+               *dst = NULL;
+               *dst_len = 0;
+               return 0;
+       }
+
        bitmap_len = src->highbit / 8;
        if (src->highbit % 7)
                bitmap_len += 1;
-       if (bitmap_len == 0)
-               return -EINVAL;
 
        bitmap = kzalloc((bitmap_len & ~(sizeof(MAPTYPE) - 1)) +
                         sizeof(MAPTYPE),