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
commit 89d58aebe14a365c25ba6645414afdbf4e41cea4 upstream.

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/20220106002952.25883-1-brian.silverman@bluerivertech.com
Link: candle-usb/candleLight_fw#87
Cc: stable@vger.kernel.org
Signed-off-by: Brian Silverman <brian.silverman@bluerivertech.com>
[mkl: initialize the reserved member, too]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
brian-brt authored and ZorEl212 committed Jun 15, 2024
1 parent 1f023a2 commit 430fd05
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 @@ -515,6 +515,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 430fd05

Please sign in to comment.