[openib-general] [PATCH][uverbs] cleanup after error

Michael S. Tsirkin mst at mellanox.co.il
Mon Feb 28 01:49:08 PST 2005


The pd is already allocated when idr_pre_get is called. So, must deallocate
on error.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: core/uverbs_cmd.c
===================================================================
--- core/uverbs_cmd.c	(revision 1922)
+++ core/uverbs_cmd.c	(working copy)
@@ -154,7 +154,7 @@ ssize_t ib_uverbs_alloc_pd(struct ib_uve
 retry:
 	if (!idr_pre_get(&ib_uverbs_pd_idr, GFP_KERNEL)) {
 		ret = -ENOMEM;
-		goto err;
+		goto err_pd;
 	}
 
 	down(&ib_uverbs_idr_mutex);

-- 
MST - Michael S. Tsirkin



More information about the general mailing list