All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	RDMA mailing list
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Jack Morgenstein
	<jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
	Mark Bloch <markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH rdma-next 2/5] RDMA/mlx5: Avoid memory leak in case of XRCD dealloc failure
Date: Sun, 28 Jan 2018 13:07:18 +0200	[thread overview]
Message-ID: <20180128110717.GA7001@yuvallap> (raw)
In-Reply-To: <20180128092533.4156-3-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On Sun, Jan 28, 2018 at 11:25:30AM +0200, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> Failure in XRCD FW deallocation command leaves memory leaked and
> returns error to the user which he can't do anything about it.
> 
> This patch changes behavior to always free memory and always return
> success to the user.
> 
> Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
> Reviewed-by: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/qp.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
> index b06a2f9a8df4..39d24bf694a8 100644
> --- a/drivers/infiniband/hw/mlx5/qp.c
> +++ b/drivers/infiniband/hw/mlx5/qp.c
> @@ -5066,13 +5066,10 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd)
>  	int err;
> 
>  	err = mlx5_core_xrcd_dealloc(dev->mdev, xrcdn);
> -	if (err) {
> +	if (err)
>  		mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn);
> -		return err;
> -	}
> 
>  	kfree(xrcd);
> -
>  	return 0;

In this case suggesting to make the function return void.

>  }
> 
> --
> 2.16.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-01-28 11:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-28  9:25 [PATCH rdma-next 0/5] RDMA fixes for 4.16 Leon Romanovsky
     [not found] ` <20180128092533.4156-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28  9:25   ` [PATCH rdma-next 1/5] IB/umad: Fix use of unprotected device pointer Leon Romanovsky
2018-01-28  9:25   ` [PATCH rdma-next 2/5] RDMA/mlx5: Avoid memory leak in case of XRCD dealloc failure Leon Romanovsky
     [not found]     ` <20180128092533.4156-3-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28 11:07       ` Yuval Shaia [this message]
2018-01-28 12:52         ` Leon Romanovsky
     [not found]           ` <20180128125208.GX1393-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-28 13:25             ` Yuval Shaia
2018-01-28 13:37               ` Leon Romanovsky
     [not found]                 ` <20180128133755.GY1393-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-28 16:19                   ` Jason Gunthorpe
2018-01-28  9:25   ` [PATCH rdma-next 3/5] IB/core: Avoid SGID attributes query while converting GID from OPA to IB Leon Romanovsky
     [not found]     ` <20180128092533.4156-4-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28 11:11       ` Yuval Shaia
2018-01-28  9:25   ` [PATCH rdma-next 4/5] RDMA/cma: Use existing netif_is_bond_master function Leon Romanovsky
     [not found]     ` <20180128092533.4156-5-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28 11:22       ` Yuval Shaia
2018-01-28  9:25   ` [PATCH rdma-next 5/5] RDMA/cm: Fix access to uninitialized variable Leon Romanovsky
     [not found]     ` <20180128092533.4156-6-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-28 11:38       ` Yuval Shaia
2018-01-28 21:12   ` [PATCH rdma-next 0/5] RDMA fixes for 4.16 Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180128110717.GA7001@yuvallap \
    --to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.