Message ID | 20200227160257.340737-2-omosnace@redhat.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | libsepol: Speed up policy optimization | expand |
On Thu, Feb 27, 2020 at 11:03 AM Ondrej Mosnacek <omosnace@redhat.com> wrote: > > I copy-pasted it from a different part of the code, which had to deal > with policydb that isn't final yet. Since we only deal with the final > kernel policy here, we can skip the check for the type datum being NULL. > > Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
On Tue, Mar 17, 2020 at 2:20 PM Stephen Smalley <stephen.smalley.work@gmail.com> wrote: > > On Thu, Feb 27, 2020 at 11:03 AM Ondrej Mosnacek <omosnace@redhat.com> wrote: > > > > I copy-pasted it from a different part of the code, which had to deal > > with policydb that isn't final yet. Since we only deal with the final > > kernel policy here, we can skip the check for the type datum being NULL. > > > > Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> > > Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com> Applied. Thanks, Jim
diff --git a/libsepol/src/optimize.c b/libsepol/src/optimize.c index 1e5e97e8..4d835d47 100644 --- a/libsepol/src/optimize.c +++ b/libsepol/src/optimize.c @@ -40,8 +40,7 @@ static ebitmap_t *build_type_map(const policydb_t *p) return NULL; for (i = 0; i < p->p_types.nprim; i++) { - if (p->type_val_to_struct[i] && - p->type_val_to_struct[i]->flavor != TYPE_ATTRIB) { + if (p->type_val_to_struct[i]->flavor != TYPE_ATTRIB) { if (ebitmap_cpy(&map[i], &p->type_attr_map[i])) goto err; } else {
I copy-pasted it from a different part of the code, which had to deal with policydb that isn't final yet. Since we only deal with the final kernel policy here, we can skip the check for the type datum being NULL. Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> --- libsepol/src/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)