From: Huaisheng Ye Date: Fri, 10 Jan 2020 09:58:56 +0000 (+0800) Subject: selinux: remove redundant msg_msg_alloc_security X-Git-Tag: v5.6-rc1~181^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b82f3f6894ec68dfada736bdf87997b1e0d3b53f;p=thirdparty%2Fkernel%2Flinux.git selinux: remove redundant msg_msg_alloc_security selinux_msg_msg_alloc_security only calls msg_msg_alloc_security but do nothing else. And also msg_msg_alloc_security is just used by the former. Remove the redundant function to simplify the code. Signed-off-by: Huaisheng Ye Acked-by: Stephen Smalley Signed-off-by: Paul Moore --- diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 63a6e36abe9ff..81f570cffee51 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -5894,16 +5894,6 @@ static void ipc_init_security(struct ipc_security_struct *isec, u16 sclass) isec->sid = current_sid(); } -static int msg_msg_alloc_security(struct msg_msg *msg) -{ - struct msg_security_struct *msec; - - msec = selinux_msg_msg(msg); - msec->sid = SECINITSID_UNLABELED; - - return 0; -} - static int ipc_has_perm(struct kern_ipc_perm *ipc_perms, u32 perms) { @@ -5922,7 +5912,12 @@ static int ipc_has_perm(struct kern_ipc_perm *ipc_perms, static int selinux_msg_msg_alloc_security(struct msg_msg *msg) { - return msg_msg_alloc_security(msg); + struct msg_security_struct *msec; + + msec = selinux_msg_msg(msg); + msec->sid = SECINITSID_UNLABELED; + + return 0; } /* message queue security operations */