1 From 3681c556d79797f132e18973611a14681ed47f76 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 30 Apr 2020 09:52:50 +0100
4 Subject: [PATCH] media: bcm2835-unicam: Fix reference counting in
7 The reference counting of node->open was only incremented after
8 a check that the node was v4l2_fh_is_singular_file, which resulted
9 in the counting going wrong and s_power not being called at an
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 drivers/media/platform/bcm2835/bcm2835-unicam.c | 4 +++-
15 1 file changed, 3 insertions(+), 1 deletion(-)
17 --- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
18 +++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
19 @@ -2170,16 +2170,18 @@ static int unicam_open(struct file *file
25 if (!v4l2_fh_is_singular_file(file))
28 ret = v4l2_subdev_call(dev->sensor, core, s_power, 1);
29 if (ret < 0 && ret != -ENOIOCTLCMD) {
30 v4l2_fh_release(file);