u32 buf[3], mapsize, count, i; u64 map; 
__le32 buf[3]; u32 mapsize, count, i; __le64 map; 
int ebitmap_read(struct ebitmap *e, void *fp){	int rc;	struct ebitmap_node *n, *l;	u32 buf[3], mapsize, count, i;	u64 map;	ebitmap_init(e);	rc = next_entry(buf, fp, sizeof buf);	if (rc < 0)		goto out;	mapsize = le32_to_cpu(buf[0]);	e->highbit = le32_to_cpu(buf[1]);	count = le32_to_cpu(buf[2]);	if (mapsize != MAPSIZE) {		printk(KERN_ERR "security: ebitmap: map size %u does not "		       "match my size %Zd (high bit was %d)\n", mapsize,		       MAPSIZE, e->highbit);		goto bad;	}	if (!e->highbit) {		e->node = NULL;		goto ok;	}	if (e->highbit & (MAPSIZE - 1)) {		printk(KERN_ERR "security: ebitmap: high bit (%d) is not a "		       "multiple of the map size (%Zd)\n", e->highbit, MAPSIZE);		goto bad;	}	l = NULL;	for (i = 0; i < count; i++) {		rc = next_entry(buf, fp, sizeof(u32));		if (rc < 0) {			printk(KERN_ERR "security: ebitmap: truncated map\n");			goto bad;		}		n = kmalloc(sizeof(*n), GFP_KERNEL);		if (!n) {			printk(KERN_ERR "security: ebitmap: out of memory\n");			rc = -ENOMEM;			goto bad;		}		memset(n, 0, sizeof(*n));		n->startbit = le32_to_cpu(buf[0]);		if (n->startbit & (MAPSIZE - 1)) {			printk(KERN_ERR "security: ebitmap start bit (%d) is "			       "not a multiple of the map size (%Zd)\n",			       n->startbit, MAPSIZE);			goto bad_free;		}		if (n->startbit > (e->highbit - MAPSIZE)) {			printk(KERN_ERR "security: ebitmap start bit (%d) is "			       "beyond the end of the bitmap (%Zd)\n",			       n->startbit, (e->highbit - MAPSIZE));			goto bad_free;		}		rc = next_entry(&map, fp, sizeof(u64));		if (rc < 0) {			printk(KERN_ERR "security: ebitmap: truncated map\n");			goto bad_free;		}		n->map = le64_to_cpu(map);		if (!n->map) {			printk(KERN_ERR "security: ebitmap: null map in "			       "ebitmap (startbit %d)\n", n->startbit);			goto bad_free;		}		if (l) {			if (n->startbit <= l->startbit) {				printk(KERN_ERR "security: ebitmap: start "				       "bit %d comes after start bit %d\n",				       n->startbit, l->startbit);				goto bad_free;			}			l->next = n;		} else			e->node = n;		l = n;	}ok:	rc = 0;out:	return rc;bad_free:	kfree(n);bad:	if (!rc)		rc = -EINVAL;	ebitmap_destroy(e);	goto out;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b5bf6c55edf94e9c7fc01724d5b271f78eaf1d3f/ebitmap.c/clean/security/selinux/ss/ebitmap.c