i2c: imx: Fix PM reference leak in i2c_imx_reg_slave()
pm_runtime_get_sync() will increment the PM reference count even on failure. Forgetting to put the reference again will result in a leak. Replace it with pm_runtime_resume_and_get() to keep the usage counter balanced. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ye Weihua <yeweihua4@huawei.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Showing
Please register or sign in to comment