Browse Source

[PATCH] IB/mthca: release mutex on doorbell alloc error path

Release mutex on error return path from mthca_alloc_db().

Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier 20 years ago
parent
commit
2714eb5a4f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/infiniband/hw/mthca/mthca_memfree.c

+ 2 - 1
drivers/infiniband/hw/mthca/mthca_memfree.c

@@ -337,7 +337,8 @@ int mthca_alloc_db(struct mthca_dev *dev, int type, u32 qn, u32 **db)
 		break;
 
 	default:
-		return -1;
+		ret = -EINVAL;
+		goto out;
 	}
 
 	for (i = start; i != end; i += dir)