diff options
author | Qiushi Wu <wu000273@umn.edu> | 2020-06-14 00:30:08 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-09-27 10:51:57 +0200 |
commit | aaffa0126a111d65f4028c503c76192d4cc93277 (patch) | |
tree | 4ec96616a41e7789824347443353ba625ab13ce3 /drivers/media | |
parent | 98fae901c8883640202802174a4bd70a1b9118bd (diff) | |
download | linux-aaffa0126a111d65f4028c503c76192d4cc93277.tar.bz2 |
media: rcar-vin: Fix a reference count leak.
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus call pm_runtime_put_noidle()
if pm_runtime_get_sync() fails.
Fixes: 90dedce9bc54 ("media: rcar-vin: add function to manipulate Gen3 chsel value")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/rcar-vin/rcar-dma.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index d067439b0b0d..3504dd4a70e9 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -1420,8 +1420,10 @@ int rvin_set_channel_routing(struct rvin_dev *vin, u8 chsel) int ret; ret = pm_runtime_get_sync(vin->dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put_noidle(vin->dev); return ret; + } /* Make register writes take effect immediately. */ vnmc = rvin_read(vin, VNMC_REG); |