From patchwork Mon Dec 2 16:21:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 180619 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp182901ile; Mon, 2 Dec 2019 08:21:42 -0800 (PST) X-Google-Smtp-Source: APXvYqz0UcoKf3te5dwCGvr85Z4si0vf7qf3leAP6AHFBKdUcNjg/K79rC/FPRPZqwgCPil9HOw/ X-Received: by 2002:a5d:4983:: with SMTP id r3mr54752801wrq.134.1575303702320; Mon, 02 Dec 2019 08:21:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575303702; cv=none; d=google.com; s=arc-20160816; b=fSYeEuN9VRMA+foyBFt6/r+DwRFuD28FSvXpwwI4VL1lvvGl/uExLJrg2B9Zoj639w RfIQTNqoWCseCYa+VDijbPzLENqHnzAj+B7fd+qjTtd6RK811cBn9t/xdUJyzSP5Bxy1 P1Fh3GDXQWQ0c6jNivMPLPQ3PdexioosWDFqmZ32+AsX1ny2VVsECBmYDsyxYhEAUo2i PzBIdpnZeEVp/L2dY0JvbrxaSS7Yfmpbf5+/qKxnzJqFL2kLTsGDgyROVcMgRSE6h5YK 6dsXABhiIQEi6oFl8MccwZ9FrjaPCtEtLibYY6/1bLxL3FsqSrXxtChJi5TStuN9/hLa ebog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=i3hce8rncscuvP/l1ZHZTtieB5MS4JyYpc/T2PE+Kxk=; b=Gib1z44DXt774yg8qxs3jJtfXr6599NqL3oHJfoyHL0e5EPyjgAdZemYXhKid2HTQx uu6ISU0VqshhWW+EwPf5jPTJ/uRkvOTx5kR1DMPsX0h3NX4y3q9iFHPVSYwW3HjXYsGa jc7KXifaXsgZil9GKmHPO3GmLcz/NqzjTtgfnATGfboXGBaCHhv6kmRetKzXlt481QSi HuV+gCJrWbQ1jVzLO2WRy2U0LmtDa5JpS2ElgKYBbFp0lNu2GWaj0N31cnT+39sYPyJX v78jDLdAx/K7jJB8S9yALUt+b9CQJMdjCRPULfNzVrlbzVQOBT7W/HmJew4M4q/UMeeZ dptw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BE1Rz6vN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd11si14535749ejb.177.2019.12.02.08.21.41; Mon, 02 Dec 2019 08:21:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BE1Rz6vN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727648AbfLBQVj (ORCPT + 27 others); Mon, 2 Dec 2019 11:21:39 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36590 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727418AbfLBQVi (ORCPT ); Mon, 2 Dec 2019 11:21:38 -0500 Received: by mail-wr1-f66.google.com with SMTP id z3so45034282wru.3 for ; Mon, 02 Dec 2019 08:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i3hce8rncscuvP/l1ZHZTtieB5MS4JyYpc/T2PE+Kxk=; b=BE1Rz6vNXRg7sd9D4JsqoBEe+a6i+xNVBv+xt5suxCeM/F5EH1GxIAP5zZ8GnNiX8e SDyYr7SH0N/I5WLB8b3Z0n7DI7l62lJN3psAJGsLawlizXLVRQjLEYAVuI/uA/eGwosu 4Y+oO0D1Ymr8GhkMET7OvboWgv9L7A+MWQEgSKOTv9OLFNNBX1DlgunxhAowoP1gbAhO OIQ9RJ+oaW67J5IzFVih/bd/+X8h2yJx/5lQFKxzOC4OVLi8NomZj03ZFGq9ob8p82Rt D8aa46nTbH5GZszd7+KPwWdSSS3jgclFK55df+IYNRP3jzdd8HAz7vfUGHRh7Ag/2wb0 wFXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i3hce8rncscuvP/l1ZHZTtieB5MS4JyYpc/T2PE+Kxk=; b=Vd1jz/M6xqy60LBQqDRQZspklEXvMp6RWm4ujODoHDVH5Ifjqa9af+c7KW74ydeX/e 7H/kat/Jn1+5P4p8v3DUaUlmqAVPtVIDfb0uty6cDUAbzxrbgfdLHWNRJr+J7iZYgut4 4QpK5IDbxTF5JZwD3w3mgoK4hlXchEcgeOMlPVhr9GAY0vPz+p5pyX7Hhuaw8DiPmHqy pQOy20LKF2T8KZ42ZAgxJG7XUkBZW9+qKvgfWzb+CDdpiB/y68I37Y1bUEPbCjwQTl4P Ohad7on8/zQHExoWAtO4d61b4dm5hEWoXcqKnIQOTxOUu9iy/7y2M7t0xr/XYeuQXQX7 6rdw== X-Gm-Message-State: APjAAAW87qRjw+YA0RNSJqBnvqxKhjlsp0ODXhtF14Yli5cMQTNFN4qH TBYI/UGAbSjPGgpw2z1V9fQXBQ== X-Received: by 2002:adf:b19a:: with SMTP id q26mr25103318wra.79.1575303696450; Mon, 02 Dec 2019 08:21:36 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id i9sm39204516wrb.2.2019.12.02.08.21.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Dec 2019 08:21:35 -0800 (PST) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: bjorn.andersson@linaro.org, agross@kernel.org, digetx@gmail.com, evgreen@chromium.org, daidavid1@codeaurora.org, masneyb@onstation.org, sibis@codeaurora.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v2 1/5] interconnect: qcom: sdm845: Walk the list safely on node removal Date: Mon, 2 Dec 2019 18:21:29 +0200 Message-Id: <20191202162133.7089-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As we will remove items off the list using list_del(), we need to use the safe version of list_for_each_entry(). Fixes: b5d2f741077a ("interconnect: qcom: Add sdm845 interconnect provider driver") Reported-by: Dmitry Osipenko Signed-off-by: Georgi Djakov --- v2: - Fix the number of parameters that got messed up. (Bjorn) drivers/interconnect/qcom/sdm845.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c index 502a6c22b41e..387267ee9648 100644 --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -868,9 +868,9 @@ static int qnoc_remove(struct platform_device *pdev) { struct qcom_icc_provider *qp = platform_get_drvdata(pdev); struct icc_provider *provider = &qp->provider; - struct icc_node *n; + struct icc_node *n, *tmp; - list_for_each_entry(n, &provider->nodes, node_list) { + list_for_each_entry_safe(n, tmp, &provider->nodes, node_list) { icc_node_del(n); icc_node_destroy(n->id); }