[PATCH] nvme: Add error path for xa_store in nvme_init_effects
Christoph Hellwig
hch at lst.de
Wed Dec 11 22:28:52 PST 2024
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.
More information about the Linux-nvme
mailing list