diff options
Diffstat (limited to 'security/selinux/ss/policydb.c')
| -rw-r--r-- | security/selinux/ss/policydb.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index e7b850ad57ee..7102457661d6 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
| @@ -502,7 +502,7 @@ static int policydb_index(struct policydb *p) | |||
| 502 | goto out; | 502 | goto out; |
| 503 | 503 | ||
| 504 | rc = flex_array_prealloc(p->type_val_to_struct_array, 0, | 504 | rc = flex_array_prealloc(p->type_val_to_struct_array, 0, |
| 505 | p->p_types.nprim - 1, GFP_KERNEL | __GFP_ZERO); | 505 | p->p_types.nprim, GFP_KERNEL | __GFP_ZERO); |
| 506 | if (rc) | 506 | if (rc) |
| 507 | goto out; | 507 | goto out; |
| 508 | 508 | ||
| @@ -519,7 +519,7 @@ static int policydb_index(struct policydb *p) | |||
| 519 | goto out; | 519 | goto out; |
| 520 | 520 | ||
| 521 | rc = flex_array_prealloc(p->sym_val_to_name[i], | 521 | rc = flex_array_prealloc(p->sym_val_to_name[i], |
| 522 | 0, p->symtab[i].nprim - 1, | 522 | 0, p->symtab[i].nprim, |
| 523 | GFP_KERNEL | __GFP_ZERO); | 523 | GFP_KERNEL | __GFP_ZERO); |
| 524 | if (rc) | 524 | if (rc) |
| 525 | goto out; | 525 | goto out; |
| @@ -1819,8 +1819,6 @@ static int filename_trans_read(struct policydb *p, void *fp) | |||
| 1819 | goto out; | 1819 | goto out; |
| 1820 | nel = le32_to_cpu(buf[0]); | 1820 | nel = le32_to_cpu(buf[0]); |
| 1821 | 1821 | ||
| 1822 | printk(KERN_ERR "%s: nel=%d\n", __func__, nel); | ||
| 1823 | |||
| 1824 | last = p->filename_trans; | 1822 | last = p->filename_trans; |
| 1825 | while (last && last->next) | 1823 | while (last && last->next) |
| 1826 | last = last->next; | 1824 | last = last->next; |
| @@ -1857,8 +1855,6 @@ static int filename_trans_read(struct policydb *p, void *fp) | |||
| 1857 | goto out; | 1855 | goto out; |
| 1858 | name[len] = 0; | 1856 | name[len] = 0; |
| 1859 | 1857 | ||
| 1860 | printk(KERN_ERR "%s: ft=%p ft->name=%p ft->name=%s\n", __func__, ft, ft->name, ft->name); | ||
| 1861 | |||
| 1862 | rc = next_entry(buf, fp, sizeof(u32) * 4); | 1858 | rc = next_entry(buf, fp, sizeof(u32) * 4); |
| 1863 | if (rc) | 1859 | if (rc) |
| 1864 | goto out; | 1860 | goto out; |
| @@ -2375,7 +2371,7 @@ int policydb_read(struct policydb *p, void *fp) | |||
| 2375 | goto bad; | 2371 | goto bad; |
| 2376 | 2372 | ||
| 2377 | /* preallocate so we don't have to worry about the put ever failing */ | 2373 | /* preallocate so we don't have to worry about the put ever failing */ |
| 2378 | rc = flex_array_prealloc(p->type_attr_map_array, 0, p->p_types.nprim - 1, | 2374 | rc = flex_array_prealloc(p->type_attr_map_array, 0, p->p_types.nprim, |
| 2379 | GFP_KERNEL | __GFP_ZERO); | 2375 | GFP_KERNEL | __GFP_ZERO); |
| 2380 | if (rc) | 2376 | if (rc) |
| 2381 | goto bad; | 2377 | goto bad; |
