From: Wanlong Gao Date: Wed, 7 Mar 2012 14:17:13 +0000 (+0800) Subject: SELinux: replace weak GFP_ATOMIC to GFP_KERNEL in avc_add_callback X-Git-Tag: firefly_0821_release~3680^2~627^2~114^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0b36e44cc680b355f0d1b34002b2a10c9e1cae60;p=firefly-linux-kernel-4.4.55.git SELinux: replace weak GFP_ATOMIC to GFP_KERNEL in avc_add_callback avc_add_callback now only called from initcalls, so replace the weak GFP_ATOMIC to GFP_KERNEL, and mark this function __init to make a warning when not been called from initcalls. Signed-off-by: Wanlong Gao Signed-off-by: Eric Paris --- diff --git a/security/selinux/avc.c b/security/selinux/avc.c index c03a964ffde2..5c1326e18836 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -510,7 +510,7 @@ noinline int slow_avc_audit(u32 ssid, u32 tsid, u16 tclass, * @perms based on @tclass. Returns %0 on success or * -%ENOMEM if insufficient memory exists to add the callback. */ -int avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid, +int __init avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid, u16 tclass, u32 perms, u32 *out_retained), u32 events, u32 ssid, u32 tsid, @@ -519,7 +519,7 @@ int avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid, struct avc_callback_node *c; int rc = 0; - c = kmalloc(sizeof(*c), GFP_ATOMIC); + c = kmalloc(sizeof(*c), GFP_KERNEL); if (!c) { rc = -ENOMEM; goto out;