public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] selinux:replace weak GFP_ATOMIC to GFP_KERNEL in avc_add_callback
@ 2012-03-07 14:17 Wanlong Gao
  2012-03-07 14:17 ` [PATCH 2/2] selinux:avc:remove the useless fields " Wanlong Gao
  0 siblings, 1 reply; 6+ messages in thread
From: Wanlong Gao @ 2012-03-07 14:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Wanlong Gao, Eric Paris, James Morris, sds, linux-security-module,
	linux-kernel

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>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-03  3:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 14:17 [PATCH 1/2] selinux:replace weak GFP_ATOMIC to GFP_KERNEL in avc_add_callback Wanlong Gao
2012-03-07 14:17 ` [PATCH 2/2] selinux:avc:remove the useless fields " Wanlong Gao
2012-03-21 23:58   ` Wanlong Gao
2012-03-26 13:51     ` Wanlong Gao
2012-03-27 20:22       ` Eric Paris
2012-04-03  3:00         ` Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox