selinux: remove unnecessary pointer reassignment
authorJeff Vander Stoep <jeffv@google.com>
Thu, 26 Feb 2015 21:54:17 +0000 (13:54 -0800)
committerPaul Moore <pmoore@redhat.com>
Tue, 7 Apr 2015 00:04:54 +0000 (20:04 -0400)
Commit f01e1af445fa ("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 <jeffv@google.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
[PM: tweaked subject line]
Signed-off-by: Paul Moore <pmoore@redhat.com>
security/selinux/avc.c

index afcc0ae..3c17dda 100644 (file)
@@ -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))