Skip to content
Commit 1b391c7f authored by Zhang Qilong's avatar Zhang Qilong Committed by Miquel Raynal
Browse files

mtd: rawnand: gpmi: fix reference count leak in gpmi ops

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 leak in
the two functions(gpmi_init and gpmi_nfc_exec_op). Moreover,
this device cannot enter the idle state and always stay busy or
other non-idle state later. So we fixed it through adding
pm_runtime_put_noidle.

Fixes: 5bc6bb60

 ("mtd: rawnand: gpmi: Fix suspend/resume problem")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Acked-by: default avatarHan Xu <han.xu@nxp.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20201107110552.1568742-1-zhangqilong3@huawei.com
parent 6d912c49
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment