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:Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Stable-dep-of: c766c90f ("media: rcar_fdp1: Fix refcount leak in probe and remove function") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment