mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Cc: hch@lst.de, sagi@grimberg.me, axboe@kernel.dk,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme-pci: return -EINVAL when failing to parse quirk parameter
Date: Wed, 19 Aug 2026 09:02:05 -0600	[thread overview]
Message-ID: <aoXFbSOKEnOMrfYB@kbusch-mbp> (raw)
In-Reply-To: <20260815134745.7263-1-sreekuttan2156239@gmail.com>

On Sat, Aug 15, 2026 at 01:47:45PM +0000, Sreeraj S Kurup wrote:
> In quirks_param_set(), if nvme_parse_quirk_entry() fails to parse an
> entry from the user-provided quirks string, the function prints an
> error message with pr_err() and jumps to out_free_qlist to free
> resources.
> 
> However, the variable 'err' is not updated upon parse failure,
> retaining the value '0' from the preceding call to
> param_set_copystring(). As a result, quirks_param_set() frees the
> allocated memory but returns 0 (success) to the kernel parameter
> subsystem, silently masking the parsing failure and incorrectly
> reporting success to the caller.
> 
> Fix this by explicitly setting 'err = -EINVAL;' before jumping to
> out_free_qlist, ensuring that parse failures are correctly propagated
> to the caller.

This fix was submitted earlier:

https://lore.kernel.org/linux-nvme/20260729105958.1403095-1-kanie@linux.alibaba.com/

      parent reply	other threads:[~2026-08-19 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-15 13:47 Sreeraj S Kurup
2026-08-17  7:00 ` Christoph Hellwig
2026-08-19 15:02 ` Keith Busch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aoXFbSOKEnOMrfYB@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=sreekuttan2156239@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®