From df2fa9b50e1c0e93c6be1d31a5d69eb4f077add3 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 27 May 2011 15:57:28 -0700 Subject: [PATCH] datapath: Don't call genlmsg_reply() under rcu_read_lock(). genlmsg_reply() indirectly makes a call to kmalloc but takes no GFP flags, instead using GFP_ATOMIC if in a softirq and GFP_KERNEL otherwise. However, here we hold rcu_read_lock(), which requires GFP_ATOMIC but is not a softirq. Since we've already built the reply message, it is safe to release rcu_read_lock(), so do that before calling genlmsg_reply(). Signed-off-by: Jesse Gross CC: Hao Zheng Acked-by: Ben Pfaff --- datapath/datapath.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 826d8991..72801224 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1904,7 +1904,9 @@ static int odp_vport_cmd_get(struct sk_buff *skb, struct genl_info *info) if (IS_ERR(reply)) goto exit_unlock; - err = genlmsg_reply(reply, info); + rcu_read_unlock(); + + return genlmsg_reply(reply, info); exit_unlock: rcu_read_unlock(); -- 2.30.2