From: Alan Stern Date: Fri, 30 Jan 2015 17:58:26 +0000 (-0500) Subject: USB: fix use-after-free bug in usb_hcd_unlink_urb() X-Git-Tag: v3.2.69~196 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52c28541efcc9d5bd0a4cb223aade27ed81422bb;p=pandora-kernel.git USB: fix use-after-free bug in usb_hcd_unlink_urb() commit c99197902da284b4b723451c1471c45b18537cde upstream. The usb_hcd_unlink_urb() routine in hcd.c contains two possible use-after-free errors. The dev_dbg() statement at the end of the routine dereferences urb and urb->dev even though both structures may have been deallocated. This patch fixes the problem by storing urb->dev in a local variable (avoiding the dereference of urb) and moving the dev_dbg() up before the usb_put_dev() call. Signed-off-by: Alan Stern Reported-by: Joe Lawrence Tested-by: Joe Lawrence Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed