]> git.baikalelectronics.ru Git - kernel.git/commitdiff
can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved}
authorBrian Silverman <brian.silverman@bluerivertech.com>
Thu, 6 Jan 2022 00:29:50 +0000 (16:29 -0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 9 Jan 2022 12:32:28 +0000 (13:32 +0100)
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: f619109f865f ("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: https://github.com/candle-usb/candleLight_fw/issues/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>
drivers/net/can/usb/gs_usb.c

index d7ce2c5956f4ce89f52289c79436332b9ad5a800..4d43aca2ff568f38f2b797e20ec67b42de80168e 100644 (file)
@@ -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;