]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: fdp: add null check of devm_kmalloc_array in fdp_nci_i2c_read_device_properties
authorKang Chen <void0red@gmail.com>
Mon, 27 Feb 2023 09:30:37 +0000 (17:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:22 +0000 (08:50 +0100)
commitd0625a91fab13128f62ca659afffc1ccd38ddee0
tree753867472093874996fb185440ad611b4527bc73
parent6508e0fc6f4552b66b51b276c281807dbd5b9833
nfc: fdp: add null check of devm_kmalloc_array in fdp_nci_i2c_read_device_properties

[ Upstream commit 7225943de59f506f24939ef05b7334186b30e896 ]

devm_kmalloc_array may fails, *fw_vsc_cfg might be null and cause
out-of-bounds write in device_property_read_u8_array later.

Fixes: 9caf4e7dab77 ("NFC: Add Intel Fields Peak NFC solution driver")
Signed-off-by: Kang Chen <void0red@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230227093037.907654-1-void0red@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nfc/fdp/i2c.c