diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-05-22 17:51:39 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-01 13:18:07 +0200 |
commit | 63f600d87b05b69c4ac963898263c5e092f0e76c (patch) | |
tree | 95676efa28cbd5f8ec7be60553735d6a6ca9f195 /drivers/mtd | |
parent | ec705f9ffbbaeead254cfa0b7fd034cf2ddbea0f (diff) | |
download | linux-stable-63f600d87b05b69c4ac963898263c5e092f0e76c.tar.gz linux-stable-63f600d87b05b69c4ac963898263c5e092f0e76c.tar.bz2 linux-stable-63f600d87b05b69c4ac963898263c5e092f0e76c.zip |
mtd: rawnand: gpmi: Fix runtime PM imbalance on error
[ Upstream commit 550e68ea36a6671a96576c0531685ce6e6c0d19d ]
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522095139.19653-1-dinghao.liu@zju.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c index b9d5d55a5edb..ef89947ee319 100644 --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -540,8 +540,10 @@ static int bch_set_geometry(struct gpmi_nand_data *this) return ret; ret = pm_runtime_get_sync(this->dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put_autosuspend(this->dev); return ret; + } /* * Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this |