From: Jonathan Nieder Date: Sun, 1 May 2011 09:29:56 +0000 (-0300) Subject: cx88: hold device lock during sub-driver initialization X-Git-Tag: v2.6.39.1~40 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa7e5a133b16147d942345d4dd73665a3d8d1bb2;p=pandora-kernel.git cx88: hold device lock during sub-driver initialization commit 1d6213ab995c61f7d1d81cf6cf876acf15d6e714 upstream. cx8802_blackbird_probe makes a device node for the mpeg sub-device before it has been added to dev->drvlist. If the device is opened during that time, the open succeeds but request_acquire cannot be called, so the reference count remains zero. Later, when the device is closed, the reference count becomes negative --- uh oh. Close the race by holding core->lock during probe and not releasing until the device is in drvlist and initialization finished. Previously the BKL prevented this race. Reported-by: Andreas Huber Tested-by: Andi Huber Tested-by: Marlon de Boer Signed-off-by: Jonathan Nieder Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed