public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Keisuke Nishimura <keisuke.nishimura@inria.fr>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: Add error path for xa_store in nvme_init_effects
Date: Thu, 12 Dec 2024 07:28:52 +0100	[thread overview]
Message-ID: <20241212062852.GB5718@lst.de> (raw)
In-Reply-To: <20241202153921.55766-1-keisuke.nishimura@inria.fr>

On Mon, Dec 02, 2024 at 04:39:22PM +0100, Keisuke Nishimura wrote:
>  	if (!ctrl->effects) {
> +		struct nvme_effects_log *effects, *old;
> +
> +		effects = kzalloc(sizeof(*effects), GFP_KERNEL);
> +		if (effects)
>  			return -ENOMEM;
> +
> +		old = xa_store(&ctrl->cels, NVME_CSI_NVM, effects, GFP_KERNEL);
> +		if (xa_is_err(old)) {
> +			kfree(effects);
> +			return xa_err(old);
> +		}
> +		ctrl->effects = effects;

Please split this into a helper now that is becoming rather complex.

Otherwise this looks fine to me.


  reply	other threads:[~2024-12-12  6:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 15:39 [PATCH] nvme: Add error path for xa_store in nvme_init_effects Keisuke Nishimura
2024-12-12  6:28 ` Christoph Hellwig [this message]
2024-12-16 15:32   ` Keisuke Nishimura

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=20241212062852.GB5718@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=keisuke.nishimura@inria.fr \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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