On Mon, Feb 09, 2026 at 12:13:05PM +0100, Marco Felsch wrote:
> > > +hgs_sep_process_ascii_frame(struct hgs_efi *efi, void *_buf, size_t size)
> > > +{
> > > + struct device *dev = efi->serdev->dev;
> > > + unsigned char *payload;
> > > + unsigned int copy_bytes;
> > > + unsigned int msgid;
> > > + size_t payload_len;
> > > + u8 *buf = _buf;
> > > + size_t hdrlen;
> > > + char *p;
> > > + int ret;
> > > +
> > > + /*
> > > +  * Non addressing ASCII format:
> > > +  * S[MsgType][MsgID](,[CRC]):[Payload]
> > > +  */
> > > + if (buf[1] != HGS_EFI_SEP_ASCII_MSG_TYPE_REPLY) {
> > 
> > check buf[0] != 0 before looking at buf[1]?
> 
> I could do this, but this function is only called if buf[0] has the
> correct value (see: HGS_EFI_SEP_EXPECT_SOF).

By adding the check you can prevent other people from spending the few
minutes it takes to check that.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Reply via email to