[PATCH] mtd: rawnand: gpmi: fix reference count leak in gpmi ops

Miquel Raynal miquel.raynal at bootlin.com
Thu Nov 19 16:20:41 EST 2020


On Sat, 2020-11-07 at 11:05:52 UTC, Zhang Qilong wrote:
> 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: 5bc6bb603b4d0 ("mtd: rawnand: gpmi: Fix suspend/resume problem")
> 
> Signed-off-by: Zhang Qilong <zhangqilong3 at huawei.com>
> Acked-by: Han Xu <han.xu at nxp.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel



More information about the linux-mtd mailing list