Skip to content

Commit adf6b73

Browse files
committed
Merge tag 'linux-can-fixes-for-6.15-20250415' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says: ==================== pull-request: can 2025-04-15 The first patch is by Davide Caratti and fixes the missing derement in the protocol inuse counter for the J1939 CAN protocol. The last patch is by Weizhao Ouyang and fixes a broken quirks check in the rockchip CAN-FD driver. * tag 'linux-can-fixes-for-6.15-20250415' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: rockchip_canfd: fix broken quirks checks can: fix missing decrement of j1939_proto.inuse_idx ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 10a7796 + 6315d93 commit adf6b73

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/net/can/rockchip/rockchip_canfd-core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,15 +902,16 @@ static int rkcanfd_probe(struct platform_device *pdev)
902902
priv->can.data_bittiming_const = &rkcanfd_data_bittiming_const;
903903
priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
904904
CAN_CTRLMODE_BERR_REPORTING;
905-
if (!(priv->devtype_data.quirks & RKCANFD_QUIRK_CANFD_BROKEN))
906-
priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD;
907905
priv->can.do_set_mode = rkcanfd_set_mode;
908906
priv->can.do_get_berr_counter = rkcanfd_get_berr_counter;
909907
priv->ndev = ndev;
910908

911909
match = device_get_match_data(&pdev->dev);
912-
if (match)
910+
if (match) {
913911
priv->devtype_data = *(struct rkcanfd_devtype_data *)match;
912+
if (!(priv->devtype_data.quirks & RKCANFD_QUIRK_CANFD_BROKEN))
913+
priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD;
914+
}
914915

915916
err = can_rx_offload_add_manual(ndev, &priv->offload,
916917
RKCANFD_NAPI_WEIGHT);

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)