Commit 9fe21dc6 authored by Zhengchao Shao's avatar Zhengchao Shao Committed by Kalle Valo

wifi: ipw2200: fix memory leak in ipw_wdev_init()

In the error path of ipw_wdev_init(), exception value is returned, and
the memory applied for in the function is not released. Also the memory
is not released in ipw_pci_probe(). As a result, memory leakage occurs.
So memory release needs to be added to the error path of ipw_wdev_init().

Fixes: a3caa99e ("libipw: initiate cfg80211 API conversion (v2)")
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221209012422.182669-1-shaozhengchao@huawei.com
parent 45fc6d74
...@@ -11383,9 +11383,14 @@ static int ipw_wdev_init(struct net_device *dev) ...@@ -11383,9 +11383,14 @@ static int ipw_wdev_init(struct net_device *dev)
set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
/* With that information in place, we can now register the wiphy... */ /* With that information in place, we can now register the wiphy... */
if (wiphy_register(wdev->wiphy)) rc = wiphy_register(wdev->wiphy);
rc = -EIO; if (rc)
goto out;
return 0;
out: out:
kfree(priv->ieee->a_band.channels);
kfree(priv->ieee->bg_band.channels);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment