From: Jeff Vander Stoep Date: Thu, 26 Feb 2015 21:54:17 +0000 (-0800) Subject: selinux: remove unnecessary pointer reassignment X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=83d4a806ae46397f606de7376b831524bd3a21e5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git selinux: remove unnecessary pointer reassignment 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 Acked-by: Stephen Smalley [PM: tweaked subject line] Signed-off-by: Paul Moore --- diff --git a/security/selinux/avc.c b/security/selinux/avc.c index afcc0aed9393..3c17dda9571d 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -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))