From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 041024A32 for ; Wed, 19 Aug 2026 15:02:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787151728; cv=none; b=LqzGvVKAUJ1UDKtZboSQNpPvfA0lQYZ6OdjElb3IXI6VxKQrTz/b8ofXH1HsWAwq0Srjy7nDPMS0I3iN2KWTcj6PeG9wnbcmWzJNS+F3nSb/DJOgi+CGtKrIoGEQgWBPvHFEZbxkD+K0aR+nKeKTjzGEp+VHdFbjewTKurFjb4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787151728; c=relaxed/simple; bh=tjC4wBXK9H/yGPaBuVrImoG9Imz2+URFilcIciIs4Fs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d23Su02kLm8exjX1LgHZXTGGY0jpHLsw96WrUhjO74ar4Fpwr9udnNVX6Nb+lZ9fe8z+lkZxSeTyZHfZOhyqTGsTHR4ntz/h73Gz/q3PERuQOAjldx5DEolB9CTdzi2BEIy9i82C1mTUmtTZDvgTscFpx75KZMY0Q7CBn+dfCdg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OVwdpjUj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OVwdpjUj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 633001F000E9; Wed, 19 Aug 2026 15:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787151726; bh=ces5dtMU7ZC5afk8dWXkHnGo6+L3IZXa1VvHNJSOIlM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=OVwdpjUj2RhZHfPhbtZ8G8nUUYlmllZ0pLSYdUn3kJUpLSvgtWQAb7LO5Ss4PrzfN Hec1ZX0Z2U+drM5ZcaTW3TXWQPpuOgjlbKwUmRmobFVKw63BBYXMsQktvjn0L2n4mJ aBrndks8MMgcHVnC/MH0rN4Hz4gqOJ+T5d5w8WPnEzQV03Y1PG9p+8ArwqSTfW+sD8 UgeB7lt9icrn03hY1aguoH8RTU0/Vxm0P5Cj/iGcVnKyhl6fMgfCIUwU/K8LHCvQDB /CR4/Laij5tjaiaHWnjSsSJx83GR+1Fj8DXgKRVW6bfxAZY+SSR5X4utC9qMMhbcms cMLGb/1N5ss1A== Date: Wed, 19 Aug 2026 09:02:05 -0600 From: Keith Busch To: Sreeraj S Kurup 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 Message-ID: References: <20260815134745.7263-1-sreekuttan2156239@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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/