OSDN Git Service

usb: dwc3: ep0: fix for dead code
authorFelipe Balbi <balbi@ti.com>
Mon, 10 Nov 2014 20:39:44 +0000 (14:39 -0600)
committerFelipe Balbi <balbi@ti.com>
Mon, 10 Nov 2014 20:39:44 +0000 (14:39 -0600)
commit520fe7633692181bb6d1560d655fbdfbb7c05aaa
treea1d9f9593aa0fcfa986189c8fbc5b9d990cf873a
parent206c5f60a3d902bc4b56dab2de3e88de5eb06108
usb: dwc3: ep0: fix for dead code

commit 6856d30 (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: Dave Jones <davej@redhat.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/ep0.c