]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION
authorMartin Faltesek <mfaltesek@google.com>
Tue, 22 Nov 2022 00:42:44 +0000 (18:42 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:22:59 +0000 (11:22 +0100)
commit51c114a4065de922ebf11a09a5993247498acd04
tree4b9d88f9a804e85402ab7e4d6a8c7c6067adea3f
parentd677d3099e2b9ae2e5cf7797b4977ea860a398b9
nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION

[ Upstream commit 09fda34a4c2eb0fe2b6ae5786a696a3a152a2f06 ]

The first validation check for EVT_TRANSACTION has two different checks
tied together with logical AND. One is a check for minimum packet length,
and the other is for a valid aid_tag. If either condition is true (fails),
then an error should be triggered. The fix is to change && to ||.

Reported-by: Denis Efremov <denis.e.efremov@oracle.com>
Reviewed-by: Guenter Roeck <groeck@google.com>
Fixes: d9bcb040a1f7 ("NFC: st21nfcb: Add HCI transaction event support")
Signed-off-by: Martin Faltesek <mfaltesek@google.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nfc/st-nci/se.c