Re: [RFC PATCH] scsi: storvsc: Fix validation for unsolicited incoming packets

From: Andrea Parri
Date: Wed Sep 29 2021 - 09:56:28 EST


> > The patch looks good. But for readability, I'd suggested put the length
> > checks together like this:
> >
> > u32 minlen = rqst_id ? sizeof(struct vstor_packet) -
> > stor_device->vmscsi_size_delta : VSTOR_MIN_UNSOL_PKT_SIZE;
> >
> > if (pktlen < minlen) {
> > dev_err(&device->device,
> > "Invalid pkt: id=%llu, len=%u, minlen=%u\n",
> > rqst_id, pktlen, minlen);
> > continue;
> > }
> >
> > Thanks.
> >
> > Signed-off-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> The tag was meant to be:
> Reviewed-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>

Thank you, Haiyang. I'll update as suggested.

Andrea