Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <gaowanlong@cn.fujitsu.com>
Signed-off-by: Eric Paris <eparis@redhat.com>

authored by

Wanlong Gao and committed by
Eric Paris
0b36e44c 899838b2

+2 -2
+2 -2
security/selinux/avc.c
··· 510 510 * @perms based on @tclass. Returns %0 on success or 511 511 * -%ENOMEM if insufficient memory exists to add the callback. 512 512 */ 513 - int avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid, 513 + int __init avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid, 514 514 u16 tclass, u32 perms, 515 515 u32 *out_retained), 516 516 u32 events, u32 ssid, u32 tsid, ··· 519 519 struct avc_callback_node *c; 520 520 int rc = 0; 521 521 522 - c = kmalloc(sizeof(*c), GFP_ATOMIC); 522 + c = kmalloc(sizeof(*c), GFP_KERNEL); 523 523 if (!c) { 524 524 rc = -ENOMEM; 525 525 goto out;