Skip to content

Commit

Permalink
selinux: remove unnecessary pointer reassignment
Browse files Browse the repository at this point in the history
Commit f01e1af ("selinux: don't pass in NULL avd to avc_has_perm_noaudit")
made this pointer reassignment unnecessary. Avd should continue to reference
the stack-based copy.

Signed-off-by: Jeff Vander Stoep <[email protected]>
Acked-by: Stephen Smalley <[email protected]>
[PM: tweaked subject line]
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
jeffvanderstoep authored and pcmoore committed Apr 7, 2015
1 parent 4f9a60f commit 83d4a80
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions security/selinux/avc.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,12 +724,10 @@ inline int avc_has_perm_noaudit(u32 ssid, u32 tsid,
rcu_read_lock();

node = avc_lookup(ssid, tsid, tclass);
if (unlikely(!node)) {
if (unlikely(!node))
node = avc_compute_av(ssid, tsid, tclass, avd);
} else {
else
memcpy(avd, &node->ae.avd, sizeof(*avd));
avd = &node->ae.avd;
}

denied = requested & ~(avd->allowed);
if (unlikely(denied))
Expand Down

0 comments on commit 83d4a80

Please sign in to comment.