Commit 25723454 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Johannes Berg
Browse files

wifi: mwifiex: Fix dev_alloc_name() return value check



dev_alloc_name() returns the allocated ID on success, which could be
over 0.

Fix the return value check to check for negative error codes.

Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aYmsQfujoAe5qO02@stanley.mountain/


Fixes: 7bab5bdb ("wifi: mwifiex: Allocate dev name earlier for interface workqueue name")
Signed-off-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Reviewed-by: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
Link: https://patch.msgid.link/20260210100337.1131279-1-wenst@chromium.org


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 243307a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3148,7 +3148,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
	SET_NETDEV_DEV(dev, adapter->dev);

	ret = dev_alloc_name(dev, name);
	if (ret)
	if (ret < 0)
		goto err_alloc_name;

	priv->dfs_cac_workqueue = alloc_workqueue("MWIFIEX_DFS_CAC-%s",