Commit 3af32605 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Greg Kroah-Hartman

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: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20210307090030.22369-1-baijiaju1990@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0c59f678
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment