]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 07:46:12 +0000 (08:46 +0100)
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: d08e973a77d1 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/usb/gs_usb.c

index e3b6bcb9b50c9cbab20f18d1c4c4a5e028aff8b7..c2ce98929e0318f24a1a63aebf8b732f71734fb8 100644 (file)
@@ -491,6 +491,8 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb, struct net_device *net
 
        hf->echo_id = idx;
        hf->channel = dev->channel;
+       hf->flags = 0;
+       hf->reserved = 0;
 
        cf = (struct can_frame *)skb->data;