Commit c223a38d authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Miquel Raynal
Browse files

mtd: hyperbus: rpc-if: Fix RPM imbalance in probe error path

parent 278811d5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)

	error = rpcif_hw_init(&hyperbus->rpc, true);
	if (error)
		return error;
		goto out_disable_rpm;

	hyperbus->hbdev.map.size = hyperbus->rpc.size;
	hyperbus->hbdev.map.virt = hyperbus->rpc.dirmap;
@@ -145,8 +145,12 @@ static int rpcif_hb_probe(struct platform_device *pdev)
	hyperbus->hbdev.np = of_get_next_child(pdev->dev.parent->of_node, NULL);
	error = hyperbus_register_device(&hyperbus->hbdev);
	if (error)
		rpcif_disable_rpm(&hyperbus->rpc);
		goto out_disable_rpm;

	return 0;

out_disable_rpm:
	rpcif_disable_rpm(&hyperbus->rpc);
	return error;
}