[ofa-general] [PATCH][REPOST] drivers/infiniband/ulp/srpt: Don't deallocate pool if not allocated
davem at systemfabricworks.com
davem at systemfabricworks.com
Fri Jan 11 14:46:02 PST 2008
This is a repost of an unrelated patch that was inadvertantly included in
[PATCH] drivers/infiniband/ulp/srpt: Fix target data corruption
=====================================================================
If local buffer pool was not allocated, don't try to deallocate it.
Signed-off-by: David A. McMillen <davem at systemfabricworks.com>
---
ib_srpt.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/ib_srpt.c b/ib_srpt.c
index 1fb9d56..452cda9 100644
--- a/ib_srpt.c
+++ b/ib_srpt.c
@@ -166,3 +166,4 @@ static int srpt_mempool_create(void)
+ srpt_mempool = NULL;
return -ENOMEM;
}
@@ -171,6 +172,8 @@ static void srpt_mempool_destroy(void)
{
int i, order;
+ if (srpt_mempool == NULL) return;
+
order = get_order(mem_size);
for (i = 1; i < mem_elements; ++i)
__free_pages(srpt_mempool[i].page, order);
More information about the general
mailing list