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: omap-for-v4.1/prcm-dts-mfd-syscon-fix~86^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c99197902da284b4b723451c1471c45b18537cde;p=pandora-kernel.git USB: fix use-after-free bug in usb_hcd_unlink_urb() 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 CC: Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed