Skip to content

Commit

Permalink
usb: renesas_usbhs: fix error return code of usbhsf_pkt_handler()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jia-Ju Bai <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
XidianGeneral authored and gregkh committed Mar 23, 2021
1 parent 0c59f67 commit 3af3260
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/renesas_usbhs/fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3af3260

Please sign in to comment.