mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()
[ Upstream commit 0d9b41daa5907756a31772d8af8ac5ff25cf17c1 ]
If sock->service_name is NULL, the local variable
service_name_tlv_length will not be assigned by nfc_llcp_build_tlv(),
later leading to using value frmo the stack. Smatch warning:
net/nfc/llcp_commands.c:442 nfc_llcp_send_connect() error: uninitialized symbol 'service_name_tlv_length'.
Fixes: de9e5aeb4f ("NFC: llcp: Fix usage of llcp_add_tlv()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
66a1be7423
commit
6ca0c94f2b
1 changed files with 2 additions and 1 deletions
|
|
@ -394,7 +394,8 @@ int nfc_llcp_send_connect(struct nfc_llcp_sock *sock)
|
|||
const u8 *service_name_tlv = NULL;
|
||||
const u8 *miux_tlv = NULL;
|
||||
const u8 *rw_tlv = NULL;
|
||||
u8 service_name_tlv_length, miux_tlv_length, rw_tlv_length, rw;
|
||||
u8 service_name_tlv_length = 0;
|
||||
u8 miux_tlv_length, rw_tlv_length, rw;
|
||||
int err;
|
||||
u16 size = 0;
|
||||
__be16 miux;
|
||||
|
|
|
|||
Loading…
Reference in a new issue