Re: [PATCH] usb: cdns2: allocate the trailing ZLP before queuing data

From: Greg KH

Date: Fri Nov 20 2026 - 10:37:58 EST


On Sun, Sep 13, 2026 at 08:52:35PM +0800, Slavin Liu wrote:
> A trailing ZLP allocation currently happens after the data request
> has been accepted. Allocate and check it first, before publishing the
> data request. Free the unqueued ZLP if data mapping fails. The ZLP has
> zero length, for which the mapping helper returns success without DMA
> mapping; its enqueue has no fallible mapping step on this baseline.
>
> Detected by static analysis and reviewed with AI-assisted source auditing.

How was this tested?