OSDN Git Service

iwlwifi: mvm: fix a possible NULL pointer deference
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 30 Nov 2021 10:59:51 +0000 (12:59 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 7 Dec 2021 10:58:05 +0000 (12:58 +0200)
commit46c7b05a4f91f425d429bbe152c0185e9f8a5d18
tree677e25daedc1bbf45d149de01103ab9598a59600
parent1a4d5758692519d6de648803a6d1dbba000bfe74
iwlwifi: mvm: fix a possible NULL pointer deference

Smatch spot a possible NULL pointer dereference. Fix it.

__iwl_mvm_mac_set_key can be called with sta = NULL
Also add a NULL pointer check after memory allocation.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://lore.kernel.org/r/20211130105951.85539-1-emmanuel.grumbach@intel.com
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mei/main.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c