• Zhang Qilong's avatar
    net: fec: Fix reference count leak in fec series ops · da875fa5
    Zhang Qilong authored
    pm_runtime_get_sync() will increment pm usage at first and it will
    resume the device later. If runtime of the device has error or
    device is in inaccessible state(or other error state), resume
    operation will fail. If we do not call put operation to decrease
    the reference, it will result in reference count leak. Moreover,
    this device cannot enter the idle state and always stay busy or other
    non-idle state later. So we fixed it by replacing it with
    pm_runtime_resume_and_get.
    
    Fixes: 8fff755e ("net: fec: Ensure clocks are enabled while using mdio bus")
    Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    da875fa5
fec_main.c 101 KB