Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: lizhijian@fujitsu.com, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next] RDMA/rxe: Fix error paths in MR alloc routines
Date: Thu, 21 Jul 2022 16:15:25 -0300	[thread overview]
Message-ID: <20220721191525.GA9189@nvidia.com> (raw)
In-Reply-To: <20220715182414.21320-1-rpearsonhpe@gmail.com>

On Fri, Jul 15, 2022 at 01:24:15PM -0500, Bob Pearson wrote:
> @@ -173,12 +172,11 @@ int rxe_mr_init_user(struct rxe_pd *pd, u64 start, u64 length, u64 iova,
>  	void			*vaddr;
>  	int err;
>  
> -	umem = ib_umem_get(pd->ibpd.device, start, length, access);
> +	mr->umem = umem = ib_umem_get(&rxe->ib_dev, start, length, access);
>  	if (IS_ERR(umem)) {

So this puts an err_ptr into mr->umem and then later the cleanup:

	if (mr->umem)
		ib_umem_release(mr->umem);

Will not like it very much.

I'm OK with the idea of initializing structures that are cleaned up by
their single master cleanup, but you have to do it in a way that
doesn't put corrupted data into the object..

Jason

  parent reply	other threads:[~2022-07-21 19:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 18:24 [PATCH for-next] RDMA/rxe: Fix error paths in MR alloc routines Bob Pearson
2022-07-18  2:03 ` lizhijian
2022-07-21 19:15 ` Jason Gunthorpe [this message]
2022-07-21 20:28   ` Bob Pearson

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=20220721191525.GA9189@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lizhijian@fujitsu.com \
    --cc=rpearsonhpe@gmail.com \
    --cc=zyjzyj2000@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox