iwlwifi: pnvm: increment the pointer before checking the TLV
authorLuca Coelho <luciano.coelho@intel.com>
Wed, 10 Feb 2021 15:23:52 +0000 (17:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:30 +0000 (11:37 +0100)
commit45c720ca5d8e5bc8ee9fcdf906a9b63956fb7c0f
tree9abfa672449be3fe159e943aae11a7f0bc145e1c
parent47708895c917004cb1f85cd6141186a04eada28c
iwlwifi: pnvm: increment the pointer before checking the TLV

[ Upstream commit ff11a8ee2d2d0f78514ac9b42fb50c525ca695c7 ]

If the SKU_ID doesn't match, we don't increment the pointer and keep
checking the same TLV over and over again.

We need to increment the pointer in all situtations, namely if the TLV
is not a SKU_ID, if the SKU_ID matched or if the SKU_ID didn't match.
So we can increment the pointer already before checking for these
conditions to solve the problem.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Fixes: 6972592850c0 ("iwlwifi: read and parse PNVM file")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.de94d366f3ff.I9a5a54906cf0f4ec8af981d6066bfd771152ffb9@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c