Commit b08630d7 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by sanglipeng
Browse files

media: rcar_fdp1: fix pm_runtime_get_sync() usage count

stable inclusion
from stable-v5.10.180
commit bf91fb6c1e9d20d965654f9b13cb23f22559ef12
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8DDFN

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bf91fb6c1e9d20d965654f9b13cb23f22559ef12



--------------------------------

[ Upstream commit 45e75a8c ]

The pm_runtime_get_sync() internally increments the
dev->power.usage_count without decrementing it, even on errors.
Replace it by the new pm_runtime_resume_and_get(), introduced by:
commit dd8088d5 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
in order to properly decrement the usage counter, avoiding
a potential PM usage counter leak.

Also, right now, the driver is ignoring any troubles when
trying to do PM resume. So, add the proper error handling
for the code.

Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Stable-dep-of: c766c90f ("media: rcar_fdp1: Fix refcount leak in probe and remove function")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 3e09e5a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment