Re: [PATCH 3/4] nvme-pci: return error when parsing a quirk string fails

Daniel Wagner <[email protected]> Wed, 29 Jul 2026 15:56:05 +0200
Newsgroups org.infradead.lists.linux-nvme
Message-ID <[email protected]>
On Wed, Jul 29, 2026 at 06:59:58PM +0800, Guixin Liu wrote:
> quirks_param_set() reuses 'err', which param_set_copystring() left as 0,
> as the return value of the whole function. When nvme_parse_quirk_entry()
> fails to parse a field, the code jumps to out_free_qlist and returns that
> stale 0, so a malformed quirks= parameter is silently accepted as valid.
> 
> Set err to -EINVAL before jumping out on a parse failure.
> 
> Fixes: 7bb8c40f5ad8 ("nvme: add support for dynamic quirk configuration via module parameter")
> Signed-off-by: Guixin Liu <[email protected]>

Looks good.

Reviewed-by: Daniel Wagner <[email protected]>