]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: iwlwifi: avoid memory leak
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sat, 28 Dec 2024 20:34:15 +0000 (22:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:32 +0000 (13:49 +0100)
commit7ce13d8b59ce95122feb4996ec99a0c2c5f56bfd
treee52c1134d9ddb30a307fbe2c22a3bb3967bca5fc
parentaf525a8b2ab85291617e79a5bb18bcdcb529e80c
wifi: iwlwifi: avoid memory leak

[ Upstream commit 80e96206a3ef348fbd658d98f2f43149c36df8bc ]

A caller of iwl_acpi_get_dsm_object must free the returned object.
iwl_acpi_get_dsm_integer returns immediately without freeing
it if the expected size is more than 8 bytes. Fix that.

Note that with the current code this will never happen, since the caller
of iwl_acpi_get_dsm_integer already checks that the expected size if
either 1 or 4 bytes, so it can't exceed 8 bytes.

While at it, print the DSM value instead of the return value, as this
was the intention in the first place.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.bf61eaab99f8.Ibdc5df02f885208c222456d42c889c43b7e3b2f7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/fw/acpi.c