linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipc/mqueue: use correct gfp flags in msg_insert
@ 2012-05-14 21:05 Sasha Levin
  2012-05-14 23:54 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Sasha Levin @ 2012-05-14 21:05 UTC (permalink / raw)
  To: dledford, kosaki.motohiro, akpm; +Cc: linux-kernel, Sasha Levin

msg_insert() tries to allocate using GFP_KERNEL, while in both cases when it's called,
it's coming from an atomic context. Introduced by 7dd7edf ("ipc/mqueue: improve
performance of send/recv").

Use GFP_ATOMIC instead.

Also, fix up coding style in the kzalloc while we're there.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 ipc/mqueue.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 30f6f8f..9ec6896 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -133,7 +133,7 @@ static int msg_insert(struct msg_msg *msg, struct mqueue_inode_info *info)
 		else
 			p = &(*p)->rb_right;
 	}
-	leaf = kzalloc(sizeof(struct posix_msg_tree_node), GFP_KERNEL);
+	leaf = kzalloc(sizeof(*leaf), GFP_ATOMIC);
 	if (!leaf)
 		return -ENOMEM;
 	rb_init_node(&leaf->rb_node);
-- 
1.7.8.6


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

end of thread, other threads:[~2012-05-16  4:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-14 21:05 [PATCH] ipc/mqueue: use correct gfp flags in msg_insert Sasha Levin
2012-05-14 23:54 ` Andrew Morton
2012-05-15  2:45   ` Doug Ledford
2012-05-15 21:38     ` Andrew Morton
2012-05-16  4:37       ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).