mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
media: bcm2835-unicam: Fix reference counting in unicam_open
The reference counting of node->open was only incremented after a check that the node was v4l2_fh_is_singular_file, which resulted in the counting going wrong and s_power not being called at an appropriate time. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
popcornmix
parent
de4a66a0b4
commit
076c39e2b0
@@ -2170,16 +2170,18 @@ static int unicam_open(struct file *file)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
node->open++;
|
||||
|
||||
if (!v4l2_fh_is_singular_file(file))
|
||||
goto unlock;
|
||||
|
||||
ret = v4l2_subdev_call(dev->sensor, core, s_power, 1);
|
||||
if (ret < 0 && ret != -ENOIOCTLCMD) {
|
||||
v4l2_fh_release(file);
|
||||
node->open--;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
node->open++;
|
||||
ret = 0;
|
||||
|
||||
unlock:
|
||||
|
||||
Reference in New Issue
Block a user