• Zhang Qilong's avatar
    soc: ti: Fix reference imbalance in knav_dma_probe · b4fa7335
    Zhang Qilong authored
    The patch fix two reference leak.
    
      1) pm_runtime_get_sync will increment pm usage counter even it
         failed. Forgetting to call put operation will result in
         reference leak.
    
      2) The pm_runtime_enable will increase power disable depth. Thus
         a pairing decrement is needed on the error handling path to
         keep it balanced.
    
    We fix it by: 1) adding call pm_runtime_put_noidle or
    pm_runtime_put_sync in error handling. 2) adding pm_runtime_disable
    in error handling, to keep usage counter and disable depth balanced.
    
    Fixes: 88139ed0 ("soc: ti: add Keystone Navigator DMA support")
    Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
    Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
    b4fa7335
knav_dma.c 20.5 KB