All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Li Ximo" <lixicaicai@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb: gadget: udc-xilinx: guard EP0 dequeue against empty queue
Date: Tue, 03 Nov 2026 08:53:23 +0000	[thread overview]
Message-ID: <sashiko-outbox-194894@kernel.org> (raw)
In-Reply-To: <20261103084722.1821982-1-lixicaicai@gmail.com>

> From: Wang Haoran <haoranwangsec@gmail.com>
> 
> The EP0 dequeue side, xudc_ep0_out() and xudc_ep0_in(), calls
> list_first_entry() on ep0->queue without checking whether a request is
> queued, while the enqueue side __xudc_ep0_queue() already guards the
> same queue with list_empty() and the non-control endpoint handler
> performs the same check before its own list_first_entry().
> 
> list_first_entry() never returns NULL on an empty list; it returns the
> container_of() of the list head, i.e. a non-NULL wild pointer into the
> enclosing struct xusb_ep. Switch both functions to
> list_first_entry_or_null() and return early when no request is queued,
> making the dequeue side consistent with the rest of the driver.
> 
> This is a defensive consistency fix found by static analysis.
> 
> Fixes: 1f7c51660034 ("usb: gadget: Add xilinx usb2 device support")
> Reported-by: Wang Haoran <haoranwangsec@gmail.com>
> Reported-by: Li Ximo <lixicaicai@gmail.com>
> Reviewed-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
> Signed-off-by: Wang Haoran <haoranwangsec@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103084722.1821982-1-lixicaicai@gmail.com?part=1


  reply	other threads:[~2026-11-03  8:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  8:47 [PATCH v2] usb: gadget: udc-xilinx: guard EP0 dequeue against empty queue Li Ximo
2026-11-03  8:53 ` sashiko-bot [this message]
2026-11-04  7:08 ` S M, Suhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-194894@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lixicaicai@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.