From: Dan Carpenter <dan.carpenter@linaro.org>
To: Chen-Yu Tsai <wenst@chromium.org>
Cc: Francesco Dolcini <francesco@dolcini.it>,
linux-wireless@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [bug report] wifi: mwifiex: Allocate dev name earlier for interface workqueue name
Date: Mon, 9 Feb 2026 12:43:29 +0300 [thread overview]
Message-ID: <aYmsQfujoAe5qO02@stanley.mountain> (raw)
In-Reply-To: <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>
[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]
Hello Chen-Yu Tsai,
Commit 7bab5bdb81e3 ("wifi: mwifiex: Allocate dev name earlier for
interface workqueue name") from Jan 7, 2026 (linux-next), leads to
the following Smatch static checker warning:
drivers/net/wireless/marvell/mwifiex/cfg80211.c:3214 mwifiex_add_virtual_intf()
warn: passing positive error code '(-23)-(-22),(-12),1-64' to 'ERR_PTR'
drivers/net/wireless/marvell/mwifiex/cfg80211.c
3147
3148 SET_NETDEV_DEV(dev, adapter->dev);
3149
3150 ret = dev_alloc_name(dev, name);
3151 if (ret)
3152 goto err_alloc_name;
The dev_alloc_name() function can return 1-64 if the name has a "%d" in
it. None of the other nine callers use the positive returns. The only
thing it does is cause a crash here. We should probably fix
dev_alloc_name() as well as changing this to if (ret < 0) {.
3153
3154 priv->dfs_cac_workqueue = alloc_workqueue("MWIFIEX_DFS_CAC-%s",
3155 WQ_HIGHPRI |
3156 WQ_MEM_RECLAIM |
3157 WQ_UNBOUND, 0, dev->name);
3158 if (!priv->dfs_cac_workqueue) {
3159 mwifiex_dbg(adapter, ERROR, "cannot alloc DFS CAC queue\n");
3160 ret = -ENOMEM;
3161 goto err_alloc_cac;
3162 }
3163
regards,
dan carpenter
parent reply other threads:[~2026-02-09 9:43 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>]
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=aYmsQfujoAe5qO02@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=francesco@dolcini.it \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=wenst@chromium.org \
/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