summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/selinux/ss/sidtab.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/ss/sidtab.c b/security/selinux/ss/sidtab.c
index c9533b21942b..f6915f257486 100644
--- a/security/selinux/ss/sidtab.c
+++ b/security/selinux/ss/sidtab.c
@@ -54,7 +54,7 @@ int sidtab_insert(struct sidtab *s, u32 sid, struct context *context)
54 } 54 }
55 55
56 newnode = kmalloc(sizeof(*newnode), GFP_ATOMIC); 56 newnode = kmalloc(sizeof(*newnode), GFP_ATOMIC);
57 if (newnode == NULL) { 57 if (!newnode) {
58 rc = -ENOMEM; 58 rc = -ENOMEM;
59 goto out; 59 goto out;
60 } 60 }
@@ -98,7 +98,7 @@ static struct context *sidtab_search_core(struct sidtab *s, u32 sid, int force)
98 if (force && cur && sid == cur->sid && cur->context.len) 98 if (force && cur && sid == cur->sid && cur->context.len)
99 return &cur->context; 99 return &cur->context;
100 100
101 if (cur == NULL || sid != cur->sid || cur->context.len) { 101 if (!cur || sid != cur->sid || cur->context.len) {
102 /* Remap invalid SIDs to the unlabeled SID. */ 102 /* Remap invalid SIDs to the unlabeled SID. */
103 sid = SECINITSID_UNLABELED; 103 sid = SECINITSID_UNLABELED;
104 hvalue = SIDTAB_HASH(sid); 104 hvalue = SIDTAB_HASH(sid);