• Felipe Balbi's avatar
    usb: dwc3: ep0: fix for dead code · 520fe763
    Felipe Balbi authored
    commit 6856d30c (usb: dwc3: ep0: return early
    on NULL requests) tried to fix a minor corner
    case where we could dereference a NULL pointer
    but it also ended up introducing some dead code.
    
    Unfortunately, that dead code, if reached, could
    end up starving the endpoint request list because
    a request would never be given back when it should.
    
    Fix this by moving the check for empty request list
    before its first use.
    Reported-by: default avatarDave Jones <davej@redhat.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
    520fe763
ep0.c 25.7 KB