Skip to content

Commit c223a38

Browse files
geertumiquelraynal
authored andcommitted
mtd: hyperbus: rpc-if: Fix RPM imbalance in probe error path
If rpcif_hw_init() fails, Runtime PM is left enabled. Fixes: b04cc0d ("memory: renesas-rpc-if: Add support for RZ/G2L") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/f3070e1af480cb252ae183d479a593dbbf947685.1655457790.git.geert+renesas@glider.be
1 parent 278811d commit c223a38

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/mtd/hyperbus/rpc-if.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)
134134

135135
error = rpcif_hw_init(&hyperbus->rpc, true);
136136
if (error)
137-
return error;
137+
goto out_disable_rpm;
138138

139139
hyperbus->hbdev.map.size = hyperbus->rpc.size;
140140
hyperbus->hbdev.map.virt = hyperbus->rpc.dirmap;
@@ -145,8 +145,12 @@ static int rpcif_hb_probe(struct platform_device *pdev)
145145
hyperbus->hbdev.np = of_get_next_child(pdev->dev.parent->of_node, NULL);
146146
error = hyperbus_register_device(&hyperbus->hbdev);
147147
if (error)
148-
rpcif_disable_rpm(&hyperbus->rpc);
148+
goto out_disable_rpm;
149+
150+
return 0;
149151

152+
out_disable_rpm:
153+
rpcif_disable_rpm(&hyperbus->rpc);
150154
return error;
151155
}
152156

0 commit comments

Comments
 (0)