From: Dan Carpenter <error27@gmail.com>
To: Maurizio Lombardi <mlombard@redhat.com>
Cc: linux-nvme@lists.infradead.org
Subject: [bug report] nvme: add support for dynamic quirk configuration via module parameter
Date: Fri, 10 Apr 2026 13:13:52 +0300 [thread overview]
Message-ID: <adjNYMeHY3hz9Eb3@stanley.mountain> (raw)
Hello Maurizio Lombardi,
Commit 7bb8c40f5ad8 ("nvme: add support for dynamic quirk
configuration via module parameter") from Feb 4, 2026 (linux-next),
leads to the following Smatch static checker warning:
drivers/nvme/host/pci.c:216 quirks_param_set()
warn: missing error code here? 'nvme_parse_quirk_entry()' failed. 'err' = '0'
drivers/nvme/host/pci.c
181 static int quirks_param_set(const char *value, const struct kernel_param *kp)
182 {
183 int count, err, i;
184 struct quirk_entry *qlist;
185 char *field, *val, *sep_ptr;
186
187 err = param_set_copystring(value, kp);
188 if (err)
189 return err;
190
191 val = kstrdup(value, GFP_KERNEL);
192 if (!val)
193 return -ENOMEM;
194
195 if (!*val)
196 goto out_free_val;
197
198 count = 1;
199 for (i = 0; val[i]; i++) {
200 if (val[i] == '-')
201 count++;
202 }
203
204 qlist = kcalloc(count, sizeof(*qlist), GFP_KERNEL);
205 if (!qlist) {
206 err = -ENOMEM;
207 goto out_free_val;
208 }
209
210 i = 0;
211 sep_ptr = val;
212 while ((field = strsep(&sep_ptr, "-"))) {
213 if (nvme_parse_quirk_entry(field, &qlist[i])) {
214 pr_err("nvme: failed to parse quirk string %s\n",
215 value);
--> 216 goto out_free_qlist;
Propagate the error code from nvme_parse_quirk_entry()?
217 }
218
219 i++;
220 }
221
222 kfree(nvme_pci_quirk_list);
223 nvme_pci_quirk_count = count;
224 nvme_pci_quirk_list = qlist;
225 goto out_free_val;
226
227 out_free_qlist:
228 kfree(qlist);
229 out_free_val:
230 kfree(val);
231 return err;
232 }
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
next reply other threads:[~2026-04-10 10:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 10:13 Dan Carpenter [this message]
2026-04-10 11:28 ` [bug report] nvme: add support for dynamic quirk configuration via module parameter Maurizio Lombardi
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=adjNYMeHY3hz9Eb3@stanley.mountain \
--to=error27@gmail.com \
--cc=linux-nvme@lists.infradead.org \
--cc=mlombard@redhat.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