aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2006-07-14 03:23:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:51 -0400
commite322fedf0c59938716cdfbafbe364a170919aa1a (patch)
tree98bdffab22bf058dc952ec4775b0cd58ecef928b
parentadfaa888a292e7f38fb43668d8994f246e371f0f (diff)
[PATCH] IB/core: use correct gfp_mask in sa_query
Avoid bogus out of memory errors: fix sa_query to actually pass gfp_mask supplied by the user to idr_pre_get. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Acked-by: "Sean Hefty" <mshefty@ichips.intel.com> Acked-by: "Roland Dreier" <rdreier@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/infiniband/core/sa_query.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index e911c99ff843..aeda484ffd82 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -488,13 +488,13 @@ static void init_mad(struct ib_sa_mad *mad, struct ib_mad_agent *agent)
488 spin_unlock_irqrestore(&tid_lock, flags); 488 spin_unlock_irqrestore(&tid_lock, flags);
489} 489}
490 490
491static int send_mad(struct ib_sa_query *query, int timeout_ms) 491static int send_mad(struct ib_sa_query *query, int timeout_ms, gfp_t gfp_mask)
492{ 492{
493 unsigned long flags; 493 unsigned long flags;
494 int ret, id; 494 int ret, id;
495 495
496retry: 496retry:
497 if (!idr_pre_get(&query_idr, GFP_ATOMIC)) 497 if (!idr_pre_get(&query_idr, gfp_mask))
498 return -ENOMEM; 498 return -ENOMEM;
499 spin_lock_irqsave(&idr_lock, flags); 499 spin_lock_irqsave(&idr_lock, flags);
500 ret = idr_get_new(&query_idr, query, &id); 500 ret = idr_get_new(&query_idr, query, &id);
@@ -630,7 +630,7 @@ int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,
630 630
631 *sa_query = &query->sa_query; 631 *sa_query = &query->sa_query;
632 632
633 ret = send_mad(&query->sa_query, timeout_ms); 633 ret = send_mad(&query->sa_query, timeout_ms, gfp_mask);
634 if (ret < 0) 634 if (ret < 0)
635 goto err2; 635 goto err2;
636 636
@@ -752,7 +752,7 @@ int ib_sa_service_rec_query(struct ib_device *device, u8 port_num, u8 method,
752 752
753 *sa_query = &query->sa_query; 753 *sa_query = &query->sa_query;
754 754
755 ret = send_mad(&query->sa_query, timeout_ms); 755 ret = send_mad(&query->sa_query, timeout_ms, gfp_mask);
756 if (ret < 0) 756 if (ret < 0)
757 goto err2; 757 goto err2;
758 758
@@ -844,7 +844,7 @@ int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,
844 844
845 *sa_query = &query->sa_query; 845 *sa_query = &query->sa_query;
846 846
847 ret = send_mad(&query->sa_query, timeout_ms); 847 ret = send_mad(&query->sa_query, timeout_ms, gfp_mask);
848 if (ret < 0) 848 if (ret < 0)
849 goto err2; 849 goto err2;
850 850