From: Alan Stern Date: Thu, 16 Apr 2009 19:37:28 +0000 (-0400) Subject: USB: g_file_storage: fix use-after-free bug when closing files X-Git-Tag: v2.6.30-rc4~54^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82a10a81c853be3859b3d222db0f372ee8d2eaa2;p=pandora-kernel.git USB: g_file_storage: fix use-after-free bug when closing files This patch (as1231) fixes a use-after-free bug in g_file_storage. A device's name may not be available after the device is unregistered, even if the device structure itself is still allocated. Since close_backing_file() prints a LUN's name for debugging, it shouldn't be called after the LUN has been unregistered. That whole area needed to be cleaned up; the backing files were getting closed in a couple of different places. The patch fixes things so that they get closed in just one place, as part of the unbind procedure, immediately before the LUN is unregistered. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed