diff options
| author | Yongchao Wu <yongchao.wu@autochips.com> | 2026-03-31 08:04:07 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-04-02 09:30:25 +0200 |
| commit | 7f6f127b9bc34bed35f56faf7ecb1561d6b39000 (patch) | |
| tree | e40bf7cea2fb71b76b8e887c61c6d85840d8ab01 /include/asm-um/git@git.tavy.me:linux.git | |
| parent | 0179c6da0793ae03607002c284b53b6d584172d0 (diff) | |
usb: cdns3: gadget: fix NULL pointer dereference in ep_queue
When the gadget endpoint is disabled or not yet configured, the ep->desc
pointer can be NULL. This leads to a NULL pointer dereference when
__cdns3_gadget_ep_queue() is called, causing a kernel crash.
Add a check to return -ESHUTDOWN if ep->desc is NULL, which is the
standard return code for unconfigured endpoints.
This prevents potential crashes when ep_queue is called on endpoints
that are not ready.
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Yongchao Wu <yongchao.wu@autochips.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://patch.msgid.link/20260331000407.613298-1-yongchao.wu@autochips.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/asm-um/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
