Skip to content

Commit 8b18794

Browse files
dcarattimarckleinebudde
authored andcommitted
can: fix missing decrement of j1939_proto.inuse_idx
Like other protocols on top of AF_CAN family, also j1939_proto.inuse_idx needs to be decremented on socket dismantle. Fixes: 6bffe88 ("can: add protocol counter for AF_CAN sockets") Reported-by: Oliver Hartkopp <[email protected]> Closes: https://lore.kernel.org/linux-can/[email protected]/ Signed-off-by: Davide Caratti <[email protected]> Acked-by: Oleksij Rempel <[email protected]> Link: https://patch.msgid.link/09ce71f281b9e27d1e3d1104430bf3fceb8c7321.1742292636.git.dcaratti@redhat.com Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 65d9119 commit 8b18794

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/can/j1939/socket.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ static int j1939_sk_release(struct socket *sock)
655655
sock->sk = NULL;
656656

657657
release_sock(sk);
658+
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
658659
sock_put(sk);
659660

660661
return 0;

0 commit comments

Comments
 (0)