Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "TAKANO Mitsuhiro" <takano32@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: aspeed_udc: validate pointers before dereferencing in ast_udc_ep_enable()
Date: Sat, 28 Nov 2026 22:27:23 +0000	[thread overview]
Message-ID: <sashiko-outbox-239094@kernel.org> (raw)
In-Reply-To: <20261128-b4-aspeed-udc-ep-enable-null-v1-1-26e41e0cd96b@gmail.com>

> From: TAKANO Mitsuhiro <takano32@gmail.com>
> 
> In ast_udc_ep_enable(), desc and ep are dereferenced in local variable
> initializers (usb_endpoint_maxp(desc), ep->udc, and usb_endpoint_num(desc))
> before checking whether _ep or desc is NULL. In addition, the error path
> calls EP_DBG(ep, ...), which dereferences ep->udc and ep->ep.name when
> AST_EP_DEBUG is enabled.
> 
> Check _ep and desc for NULL first, then derive ep, udc, maxpacket, and
> epnum. Since _ep is already verified non-NULL, the redundant !ep check
> after container_of() is also removed.
> 
> Fixes: 055276c13205 ("usb: gadget: add Aspeed ast2600 udc driver")
> Signed-off-by: TAKANO Mitsuhiro <takano32@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261128-b4-aspeed-udc-ep-enable-null-v1-1-26e41e0cd96b@gmail.com?part=1

      reply	other threads:[~2026-11-28 22:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 22:21 [PATCH] usb: gadget: aspeed_udc: validate pointers before dereferencing in ast_udc_ep_enable() TAKANO Mitsuhiro via B4 Relay
2026-11-28 22:27 ` sashiko-bot [this message]

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-239094@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=takano32@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox