Re: [PATCH can 3/3] can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing data
From: Marc Kleine-Budde
Date: Tue Nov 11 2025 - 09:35:27 EST
On 11.11.2025 13:31:06, Henrik Brix Andersen wrote:
> > +static unsigned int
> > +gs_usb_get_minimum_length(const struct gs_can *dev, const struct gs_host_frame *hf,
> > + unsigned int *data_length_p)
> > +{
> > + unsigned int minimum_length, data_length;
> > +
> > + /* TX echo only uses the header */
> > + if (hf->echo_id != GS_HOST_FRAME_ECHO_ID_RX) {
> > + *data_length_p = 0;
> > + return sizeof(hf->header);
> > + }
>
> Is this correct? The embedded timestamp is also used in the
> gs_usb_get_echo_skb() function.
Right, will update.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature