From: Chris Rankin Date: Sat, 24 Sep 2011 14:02:32 +0000 (-0300) Subject: [media] em28xx: fix race on disconnect X-Git-Tag: v3.2-rc1~112^2~66 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7222e7d6fb06ca3e7aa7a1ab07f8e6c6adb1d22;p=pandora-kernel.git [media] em28xx: fix race on disconnect This patch closes the race on the device and extension lists at USB disconnect time. Previously, the device was removed from the device list during em28xx_release_resources(), and then passed to the em28xx_close_extension() function so that all extensions could run their fini() operations. However, this left a (brief, theoretical, highly unlikely ;-)) window between these two calls during which a new module could call em28xx_register_extension(). The result would have been that the em28xx_usb_disconnect() function would also have passed the device to the new extension's fini() function, despite never having called the extension's init() function. This patch also restores em28xx_close_extension()'s symmetry with em28xx_init_extension(), and establishes the property that every device in the device list must have been initialised for every extension in the extension list. Signed-off-by: Chris Rankin Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed