]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: llcp: nullify llcp_sock->dev on connect() error paths
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Wed, 2 Mar 2022 19:25:18 +0000 (20:25 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Mar 2022 10:43:37 +0000 (10:43 +0000)
commit79c8dc755ebbfdc606d3f78d9369f9bf0b6b1a1d
tree189ec2afaaf5c5ae8ab977f2dd0f41377bd03812
parenta312fbe9eee2673244432da651c3067b4a4300e7
nfc: llcp: nullify llcp_sock->dev on connect() error paths

Nullify the llcp_sock->dev on llcp_sock_connect() error paths,
symmetrically to the code llcp_sock_bind().  The non-NULL value of
llcp_sock->dev is used in a few places to check whether the socket is
still valid.

There was no particular issue observed with missing NULL assignment in
connect() error path, however a similar case - in the bind() error path
- was triggereable.  That one was fixed in commit 11af5bd7a655 ("nfc:
fix NULL ptr dereference in llcp_sock_getname() after failed connect"),
so the change here seems logical as well.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/nfc/llcp_sock.c