Browse Source

[PATCH] IB/mthca: Fix memory leak on error path

Free page_list buffer on error path of mthca_reg_phys_mr().

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
761f9eb8c3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/infiniband/hw/mthca/mthca_provider.c

+ 1 - 0
drivers/infiniband/hw/mthca/mthca_provider.c

@@ -559,6 +559,7 @@ static struct ib_mr *mthca_reg_phys_mr(struct ib_pd       *pd,
 				  convert_access(acc), mr);
 
 	if (err) {
+		kfree(page_list);
 		kfree(mr);
 		return ERR_PTR(err);
 	}