wifi: iwlwifi: check for kmemdup() return value in iwl_parse_tlv_firmware()
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 9 Oct 2023 17:04:49 +0000 (20:04 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 23 Oct 2023 10:24:24 +0000 (12:24 +0200)
commit3c8aaaa7557b1e33e6ef95a27a5d8a139dcd0874
tree306f78fe839cc0b3653b7f3fa655f98580c9777c
parent89141f965325de9aac3805cd506df788179b2809
wifi: iwlwifi: check for kmemdup() return value in iwl_parse_tlv_firmware()

In 'iwl_parse_tlv_firmware()', check for 'kmemdup()' return value
when handling IWL_UCODE_TLV_CURRENT_PC and set the number of parsed
entries only if an allocation was successful (just like it does with
handling IWL_UCODE_TLV_CMD_VERSIONS above). Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231009170453.149905-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-drv.c