iwlwifi: pnvm: don't kmemdup() more than we have
authorJohannes Berg <johannes.berg@intel.com>
Sat, 16 Oct 2021 08:43:57 +0000 (11:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:38 +0000 (19:16 +0100)
commitb0b49d055533682b8efd93a673b24f1a6fb69588
tree8b7685d40b0483403997962f6c96cfa4d567c95a
parentf2fd84b3674862cca60e5a6fcdaf6bdea1e5f755
iwlwifi: pnvm: don't kmemdup() more than we have

[ Upstream commit 0f892441d8c353144e3669b7991fa5fe0bd353e9 ]

We shouldn't kmemdup() more data than we have, that might
cause the code to crash. Fix that by updating the length
before the kmemdup.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20211016114029.ab0e64c3fba9.Ic6a3295fc384750b51b4270bf0b7d94984a139f2@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c