wifi: cfg80211: fix memory leak in query_regdb_file()
stable inclusion from stable-v5.10.155 commit e1e12180321f416d83444f2cdc9259e0f5093d35 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7M5F4 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e1e12180321f416d83444f2cdc9259e0f5093d35 -------------------------------- [ Upstream commit 57b962e6 ] In the function query_regdb_file() the alpha2 parameter is duplicated using kmemdup() and subsequently freed in regdb_fw_cb(). However, request_firmware_nowait() can fail without calling regdb_fw_cb() and thus leak memory. Fixes: 007f6c5e ("cfg80211: support loading regulatory database as firmware file") Signed-off-by:Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by:
Johannes Berg <johannes.berg@intel.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment