Skip to content

Commit

Permalink
can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved}
Browse files Browse the repository at this point in the history
No information is deliberately sent in hf->flags in host -> device
communications, but the open-source candleLight firmware echoes it
back, which can result in the GS_CAN_FLAG_OVERFLOW flag being set and
generating spurious ERRORFRAMEs.

While there also initialize the reserved member with 0.

Fixes: d08e973 ("can: gs_usb: Added support for the GS_USB CAN devices")
Link: https://lore.kernel.org/all/[email protected]
Link: candle-usb/candleLight_fw#87
Cc: [email protected]
Signed-off-by: Brian Silverman <[email protected]>
[mkl: initialize the reserved member, too]
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
brian-brt authored and marckleinebudde committed Jan 9, 2022
1 parent 72b1e36 commit 89d58ae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/can/usb/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb,

hf->echo_id = idx;
hf->channel = dev->channel;
hf->flags = 0;
hf->reserved = 0;

cf = (struct can_frame *)skb->data;

Expand Down

0 comments on commit 89d58ae

Please sign in to comment.