diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2021-03-07 10:00:30 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-23 12:42:15 +0100 |
commit | 3af32605289e9f508cc40ff1046e15ac6c80d2fa (patch) | |
tree | 5cb25a4056c48bc79a8614fd7925ec3fcb124194 /drivers/usb/renesas_usbhs | |
parent | usb: dwc3: gadget: Remove invalid low-speed setting (diff) | |
download | linux-3af32605289e9f508cc40ff1046e15ac6c80d2fa.tar.xz linux-3af32605289e9f508cc40ff1046e15ac6c80d2fa.zip |
usb: renesas_usbhs: fix error return code of usbhsf_pkt_handler()
When __usbhsf_pkt_get() returns NULL to pkt, no error return code of
usbhsf_pkt_handler() is assigned.
To fix this bug, ret is assigned with -EINVAL in this case.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20210307090030.22369-1-baijiaju1990@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index e6fa13701808..b5e7991dc7d9 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -160,8 +160,10 @@ static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type) usbhs_lock(priv, flags); pkt = __usbhsf_pkt_get(pipe); - if (!pkt) + if (!pkt) { + ret = -EINVAL; goto __usbhs_pkt_handler_end; + } switch (type) { case USBHSF_PKT_PREPARE: |