musb: potential use after free
Subsystems (2)
PATCH 1/1 musb: potential use after free
We assign "urb->hcpriv = qh;" a few lines down. I'm pretty sure we want it "urb->hcpriv" to be NULL not a freed value.
Signed-off-by Dan Carpenter <[email protected]>
---
Found with a static checker. I don't have the hardware to test this.
drivers/usb/musb/musb_host.c +1 -0
@@ -2042,6 +2042,7 @@ static int musb_urb_enqueue(* odd, rare, error prone, but legal. */ kfree (qh); + qh =NULL ; ret =0 ; }else ret = musb_schedule(musb, qh,
Felipe Balbi
AppliedQuoted 4 lines · ext Dan Carpenter
We assign "
urb->hcpriv= qh;" a few lines down. I'm pretty sure we want it "urb->hcpriv" to be NULL not a freed value.Signed-off-by Dan Carpenter <[email protected]>
applied, thanks
Signature · 1 line
balbi