[PATCH] remove unnecessary type casting

zhoun zhounan at nfschina.com
Wed Aug 10 08:39:35 UTC 2022


From: zhounan <zhounan at nfschina.com>

'policy' is already a pointer to the struct aa_profile,
 so there is no need to cast 'policy' when it is called.

Signed-off-by: zhounan <zhounan at nfschina.com>
---
 security/apparmor/policy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index b0cbc4906cb3..9643801c4ee7 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -1003,7 +1003,7 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,
 			rcu_assign_pointer(ent->new->parent, aa_get_profile(p));
 		} else if (policy != &ns->base) {
 			/* released on profile replacement or free_profile */
-			struct aa_profile *p = (struct aa_profile *) policy;
+			struct aa_profile *p = policy;
 			rcu_assign_pointer(ent->new->parent, aa_get_profile(p));
 		}
 	}
-- 
2.27.0



More information about the Linux-security-module-archive mailing list