Skip to content

Commit 637039e

Browse files
zhengchaoshaoSasha Levin
authored andcommitted
wifi: ipw2200: fix memory leak in ipw_wdev_init()
[ Upstream commit 9fe21dc ] 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: a3caa99 ("libipw: initiate cfg80211 API conversion (v2)") Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221209012422.182669-1-shaozhengchao@huawei.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6f0824f commit 637039e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/net/wireless/intel/ipw2x00/ipw2200.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11414,9 +11414,14 @@ static int ipw_wdev_init(struct net_device *dev)
1141411414
set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
1141511415

1141611416
/* With that information in place, we can now register the wiphy... */
11417-
if (wiphy_register(wdev->wiphy))
11418-
rc = -EIO;
11417+
rc = wiphy_register(wdev->wiphy);
11418+
if (rc)
11419+
goto out;
11420+
11421+
return 0;
1141911422
out:
11423+
kfree(priv->ieee->a_band.channels);
11424+
kfree(priv->ieee->bg_band.channels);
1142011425
return rc;
1142111426
}
1142211427

0 commit comments

Comments
 (0)