[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1511793987-315-2-git-send-email-geert+renesas@glider.be>
Date: Mon, 27 Nov 2017 15:46:26 +0100
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH 1/2] of: overlay: Fix cleanup order in of_overlay_apply()
The special overlay mutex is taken first, hence it should be released
last in the error path.
Fixes: f948d6d8b792bb90 ("of: overlay: avoid race condition between applying multiple overlays")
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
drivers/of/overlay.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index c150abb9049d776d..3b7a3980ff50d6bf 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -760,14 +760,14 @@ int of_overlay_apply(struct device_node *tree, int *ovcs_id)
goto out;
-err_overlay_unlock:
- of_overlay_mutex_unlock();
-
err_free_overlay_changeset:
free_overlay_changeset(ovcs);
mutex_unlock(&of_mutex);
+err_overlay_unlock:
+ of_overlay_mutex_unlock();
+
out:
pr_debug("%s() err=%d\n", __func__, ret);
--
2.7.4
Powered by blists - more mailing lists