From cc0425f34903fae511dd2db44df1a31fe9161dd1 Mon Sep 17 00:00:00 2001 From: Ondrej Mosnacek Date: Thu, 27 Feb 2020 17:02:55 +0100 Subject: [PATCH] libsepol: skip unnecessary check in build_type_map() 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 Acked-by: Stephen Smalley --- libsepol/src/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 {