Skip to content

Commit 9161f36

Browse files
ceggers-arrimiquelraynal
authored andcommitted
mtd: rawnand: gpmi: don't leak PM reference in error path
If gpmi_nfc_apply_timings() fails, the PM runtime usage counter must be dropped. Reported-by: Pavel Machek <pavel@denx.de> Fixes: f53d4c1 ("mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings") Signed-off-by: Christian Eggers <ceggers@arri.de> Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220125081619.6286-1-ceggers@arri.de
1 parent 3e37658 commit 9161f36

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ static int gpmi_nfc_exec_op(struct nand_chip *chip,
22852285
this->hw.must_apply_timings = false;
22862286
ret = gpmi_nfc_apply_timings(this);
22872287
if (ret)
2288-
return ret;
2288+
goto out_pm;
22892289
}
22902290

22912291
dev_dbg(this->dev, "%s: %d instructions\n", __func__, op->ninstrs);
@@ -2414,6 +2414,7 @@ static int gpmi_nfc_exec_op(struct nand_chip *chip,
24142414

24152415
this->bch = false;
24162416

2417+
out_pm:
24172418
pm_runtime_mark_last_busy(this->dev);
24182419
pm_runtime_put_autosuspend(this->dev);
24192420

0 commit comments

Comments
 (0)