[PATCH 3/4] nvme-pci: return error when parsing a quirk string fails
Christoph Hellwig
hch at lst.de
Wed Jul 29 04:33:03 PDT 2026
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 <hch at lst.de>
More information about the Linux-nvme
mailing list