From: Hoang-Nam Nguyen Date: Thu, 12 Jul 2007 15:48:22 +0000 (+0200) Subject: IB/ehca: Fix memory leak in error path of ehca_get_dma_mr() X-Git-Tag: v2.6.23-rc1~483^2~23 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3df78f81e070c0e3330ae1bd40385e2f0d6fea2c;p=linux-2.6 IB/ehca: Fix memory leak in error path of ehca_get_dma_mr() Signed-off-by: Joachim Fenkes Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index add79bd44e..98f253147d 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c @@ -111,6 +111,7 @@ struct ib_mr *ehca_get_dma_mr(struct ib_pd *pd, int mr_access_flags) &e_maxmr->ib.ib_mr.lkey, &e_maxmr->ib.ib_mr.rkey); if (ret) { + ehca_mr_delete(e_maxmr); ib_mr = ERR_PTR(ret); goto get_dma_mr_exit0; }