Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[patch] musb: potential use after free

2 views
Skip to first unread message

Dan Carpenter

unread,
Mar 20, 2010, 8:30:02 AM3/20/10
to
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 <err...@gmail.com>
---
Found with a static checker. I don't have the hardware to test this.

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index dec896e..877d20b 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/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,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Felipe Balbi

unread,
Mar 24, 2010, 6:30:03 AM3/24/10
to
On Sat, Mar 20, 2010 at 01:24:03PM +0100, ext Dan Carpenter wrote:
>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 <err...@gmail.com>

applied, thanks

--
balbi

0 new messages