Przeglądaj źródła

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 15 lat temu
rodzic
commit
714bc5ef3e
1 zmienionych plików z 1 dodań i 0 usunięć
  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,