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>
        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: