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

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.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0c59f678
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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: