Re: [PATCH v2] nvdimm/pmem: Propagate devm_init_badblocks() error code
From: Alison Schofield
Date: Wed Dec 02 2026 - 20:34:23 EST
On Fri, Oct 23, 2026 at 09:35:40PM +0200, Christophe JAILLET wrote:
> Propagate errors from devm_init_badblocks() instead of hard-coding a
> -ENOMEM.
>
> This change is a no-op. The sanity check in devm_init_badblocks() can't
> fail, so -EINVAL can't be returned. And __badblocks_init() can only return
> 0 or -ENOMEM.
>
> However, propagating the error code is cleaner and more future proof.
Thanks, Christophe. I’m taking the patch with a small commit message edit.
I dropped “cleaner and more future proof” because the cleanup is straight-
forward to describe: pmem_attach_disk() can use the helper’s return value
directly. -ENOMEM is still the only error this call can return today.
Applied to libnvdimm-for-next:
https://git.kernel.org/nvdimm/nvdimm/c/3860f1f60537