Commit 0b36e44c authored by Wanlong Gao's avatar Wanlong Gao Committed by Eric Paris

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: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent 899838b2
...@@ -510,7 +510,7 @@ noinline int slow_avc_audit(u32 ssid, u32 tsid, u16 tclass, ...@@ -510,7 +510,7 @@ noinline int slow_avc_audit(u32 ssid, u32 tsid, u16 tclass,
* @perms based on @tclass. Returns %0 on success or * @perms based on @tclass. Returns %0 on success or
* -%ENOMEM if insufficient memory exists to add the callback. * -%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, u16 tclass, u32 perms,
u32 *out_retained), u32 *out_retained),
u32 events, u32 ssid, u32 tsid, u32 events, u32 ssid, u32 tsid,
...@@ -519,7 +519,7 @@ int avc_add_callback(int (*callback)(u32 event, 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; struct avc_callback_node *c;
int rc = 0; int rc = 0;
c = kmalloc(sizeof(*c), GFP_ATOMIC); c = kmalloc(sizeof(*c), GFP_KERNEL);
if (!c) { if (!c) {
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment