aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88.h
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-05-01 06:29:56 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 09:29:37 -0300
commit1d6213ab995c61f7d1d81cf6cf876acf15d6e714 (patch)
tree72ebdfa1d65066a6cd5361ee605a48e2dfcda4b2 /drivers/media/video/cx88/cx88.h
parent1fe70e963028f34ba5e32488a7870ff4b410b19b (diff)
downloadkernel_samsung_smdk4412-1d6213ab995c61f7d1d81cf6cf876acf15d6e714.zip
kernel_samsung_smdk4412-1d6213ab995c61f7d1d81cf6cf876acf15d6e714.tar.gz
kernel_samsung_smdk4412-1d6213ab995c61f7d1d81cf6cf876acf15d6e714.tar.bz2
[media] cx88: hold device lock during sub-driver initialization
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 <hobrom@gmx.at> Tested-by: Andi Huber <hobrom@gmx.at> Tested-by: Marlon de Boer <marlon@hyves.nl> Cc: stable@kernel.org Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx88/cx88.h')
-rw-r--r--drivers/media/video/cx88/cx88.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 9731daa..3d32f4a 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -505,13 +505,10 @@ struct cx8802_driver {
int (*suspend)(struct pci_dev *pci_dev, pm_message_t state);
int (*resume)(struct pci_dev *pci_dev);
- /* MPEG 8802 -> mini driver - Driver probe and configuration */
-
- /* Caller must _not_ hold core->lock */
- int (*probe)(struct cx8802_driver *drv);
-
/* Callers to the following functions must hold core->lock */
+ /* MPEG 8802 -> mini driver - Driver probe and configuration */
+ int (*probe)(struct cx8802_driver *drv);
int (*remove)(struct cx8802_driver *drv);
/* MPEG 8802 -> mini driver - Access for hardware control */