Skip to content

Commit

Permalink
can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt
Browse files Browse the repository at this point in the history
This fixes an uninit-value warning:
BUG: KMSAN: uninit-value in can_receive+0x26b/0x630 net/can/af_can.c:650

Reported-and-tested-by: [email protected]
Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol")
Cc: Robin van der Gracht <[email protected]>
Cc: Oleksij Rempel <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Oliver Hartkopp <[email protected]>
Cc: Marc Kleine-Budde <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
congwang authored and marckleinebudde committed Oct 8, 2020
1 parent 81f1f5a commit e009f95
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/can/j1939/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ sk_buff *j1939_tp_tx_dat_new(struct j1939_priv *priv,
skb->dev = priv->ndev;
can_skb_reserve(skb);
can_skb_prv(skb)->ifindex = priv->ndev->ifindex;
can_skb_prv(skb)->skbcnt = 0;
/* reserve CAN header */
skb_reserve(skb, offsetof(struct can_frame, data));

Expand Down

0 comments on commit e009f95

Please sign in to comment.