Commit 80e0c7a6 authored by Jonathan Nieder's avatar Jonathan Nieder Committed by Greg Kroah-Hartman
Browse files

cx88: hold device lock during sub-driver initialization



commit 1d6213ab 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: default avatarAndreas Huber <hobrom@gmx.at>
Tested-by: default avatarAndi Huber <hobrom@gmx.at>
Tested-by: default avatarMarlon de Boer <marlon@hyves.nl>
Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d47b389e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment