From: Jia-Ju Bai Date: Sun, 7 Mar 2021 09:00:30 +0000 (-0800) Subject: usb: renesas_usbhs: fix error return code of usbhsf_pkt_handler() X-Git-Tag: accepted/tizen/unified/20230118.172025~7412^2~199 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3af32605289e9f508cc40ff1046e15ac6c80d2fa;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Jia-Ju Bai Link: https://lore.kernel.org/r/20210307090030.22369-1-baijiaju1990@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index e6fa137..b5e7991 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: