Patch "interconnect: fix icc_provider_del() error handling" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    interconnect: fix icc_provider_del() error handling

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     interconnect-fix-icc_provider_del-error-handling.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From e0e7089bf9a87bc5e3997422e4e24563424f9018 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan+linaro@xxxxxxxxxx>
Date: Mon, 6 Mar 2023 08:56:30 +0100
Subject: interconnect: fix icc_provider_del() error handling

From: Johan Hovold <johan+linaro@xxxxxxxxxx>

commit e0e7089bf9a87bc5e3997422e4e24563424f9018 upstream.

The interconnect framework currently expects that providers are only
removed when there are no users and after all nodes have been removed.

There is currently nothing that guarantees this to be the case and the
framework does not do any reference counting, but refusing to remove the
provider is never correct as that would leave a dangling pointer to a
resource that is about to be released in the global provider list (e.g.
accessible through debugfs).

Replace the current sanity checks with WARN_ON() so that the provider is
always removed.

Fixes: 11f1ceca7031 ("interconnect: Add generic on-chip interconnect API")
Cc: stable@xxxxxxxxxxxxxxx      # 5.1: 680f8666baf6: interconnect: Make icc_provider_del() return void
Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>
Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
Tested-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx> # i.MX8MP MSC SM2-MB-EP1 Board
Link: https://lore.kernel.org/r/20230306075651.2449-3-johan+linaro@xxxxxxxxxx
Signed-off-by: Georgi Djakov <djakov@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/interconnect/core.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -1061,18 +1061,8 @@ EXPORT_SYMBOL_GPL(icc_provider_add);
 void icc_provider_del(struct icc_provider *provider)
 {
 	mutex_lock(&icc_lock);
-	if (provider->users) {
-		pr_warn("interconnect provider still has %d users\n",
-			provider->users);
-		mutex_unlock(&icc_lock);
-		return;
-	}
-
-	if (!list_empty(&provider->nodes)) {
-		pr_warn("interconnect provider still has nodes\n");
-		mutex_unlock(&icc_lock);
-		return;
-	}
+	WARN_ON(provider->users);
+	WARN_ON(!list_empty(&provider->nodes));
 
 	list_del(&provider->provider_list);
 	mutex_unlock(&icc_lock);


Patches currently in stable-queue which might be from johan+linaro@xxxxxxxxxx are

queue-6.2/memory-tegra20-emc-fix-interconnect-registration-race.patch
queue-6.2/memory-tegra124-emc-fix-interconnect-registration-race.patch
queue-6.2/serial-qcom-geni-fix-console-shutdown-hang.patch
queue-6.2/interconnect-exynos-fix-registration-race.patch
queue-6.2/interconnect-imx-fix-registration-race.patch
queue-6.2/memory-tegra30-emc-fix-interconnect-registration-race.patch
queue-6.2/interconnect-qcom-msm8974-fix-registration-race.patch
queue-6.2/memory-tegra-fix-interconnect-registration-race.patch
queue-6.2/interconnect-qcom-rpm-fix-probe-child-node-error-handling.patch
queue-6.2/interconnect-qcom-rpm-fix-registration-race.patch
queue-6.2/interconnect-fix-provider-registration-api.patch
queue-6.2/interconnect-fix-icc_provider_del-error-handling.patch
queue-6.2/interconnect-qcom-rpmh-fix-registration-race.patch
queue-6.2/interconnect-fix-mem-leak-when-freeing-nodes.patch
queue-6.2/interconnect-qcom-rpmh-fix-probe-child-node-error-handling.patch
queue-6.2/interconnect-exynos-fix-node-leak-in-probe-pm-qos-error-path.patch
queue-6.2/interconnect-qcom-osm-l3-fix-registration-race.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux