Explorar o código

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 <error27@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dan Carpenter %!s(int64=15) %!d(string=hai) anos
pai
achega
714bc5ef3e
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/usb/musb/musb_host.c

+ 1 - 0
drivers/usb/musb/musb_host.c

@@ -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,