Skip to content

Commit

Permalink
SELinux: replace weak GFP_ATOMIC to GFP_KERNEL in avc_add_callback
Browse files Browse the repository at this point in the history
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 <gaowanlong@cn.fujitsu.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
  • Loading branch information
Wanlong Gao authored and Eric Paris committed Apr 9, 2012
1 parent 899838b commit 0b36e44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/selinux/avc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down

0 comments on commit 0b36e44

Please sign in to comment.