[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1331129834-1554-1-git-send-email-gaowanlong@cn.fujitsu.com>
Date: Wed, 7 Mar 2012 22:17:13 +0800
From: Wanlong Gao <gaowanlong@...fujitsu.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Wanlong Gao <gaowanlong@...fujitsu.com>,
Eric Paris <eparis@...isplace.org>,
James Morris <jmorris@...ei.org>, sds@...ho.nsa.gov,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] 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@...fujitsu.com>
---
security/selinux/avc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index dca1c22..c301679 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -557,7 +557,7 @@ int avc_audit(u32 ssid, u32 tsid,
* @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,
@@ -566,7 +566,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;
--
1.7.9.2.323.gf051a
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists