Re: [PATCH v4] usb: gadget: f_tcm: reject a short write data-out transfer
From: Yehyeong Lee
Date: Fri Nov 20 2026 - 06:31:35 EST
On Fri, Nov 20, 2026 at 12:09:52PM +0100, Greg KH wrote:
> > - if (req->status) {
> > - pr_err("%s() state %d transfer failed\n", __func__, cmd->state);
> > + /* a short data-out left the buffer unwritten; don't commit stale data */
> > + if (req->status || req->actual != req->length) {
> > + struct usb_gadget *gadget = fuas_to_gadget(cmd->fu);
> > +
> > + if (!req->status)
> > + cmd->flags |= USBG_CMD_OUT_SHORT;
> > +
> > + dev_err_ratelimited(&gadget->dev, "%s() state %d transfer failed\n",
> > + __func__, cmd->state);
>
> Why is this needed? And __func__ is never needed for dev_() calls.
It's not needed, I'll drop it.
This is an old version, the current one is patch 3/4 of v8:
https://lore.kernel.org/all/20261118124005.2428068-4-yhlee@xxxxxxxxxxxxxxxxxx/
It has the same change, I'll fix it there in v9.
Best regards,
Yehyeong Lee