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

Christoph Hellwig <[email protected]> Wed, 29 Jul 2026 13:33:03 +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.

Looks good:

Reviewed-by: Christoph Hellwig <[email protected]>