From patchwork Thu Dec 12 07:53:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 181456 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp563765ile; Wed, 11 Dec 2019 23:53:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzJjW7mZNQrKGQH4xD99a1UpkI4FBOi57tcKlUyTafkrRr5yPNAeGItJNT8Uy+MDjBwJGk2 X-Received: by 2002:a9d:7f11:: with SMTP id j17mr6942569otq.281.1576137236442; Wed, 11 Dec 2019 23:53:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576137236; cv=none; d=google.com; s=arc-20160816; b=co7E3xc0ZEJ/iB33FQ0apndGOkO7leN99LnhF1vlCuGnfIKGU+2jmyt1kSAuRG9ZEp pyl6OVe8wqxvxXT9GR4nwN/Rv92DkM4C54DqPh5ojS906uWKyhkPDdHc71ViAJbbiUh7 qoZ0o284D9Z9zzuiPiEMEfI9QEMyw/JOocKpfBtW093jHv2kmZgpwJx+Hd7Vx7E7KOTA p3By/xK1uXQiJ1qYTTIYX5T8GRa3No6iUPWjGIQcP7O8CC/ejTfI0DmcD81/0sNUstCl PM4X0wwNKhpO4AY2QoTT57VHJW/YF58TwgC3GvIkaTm6i33vkCYZffNeW67aOCXuAy/g P2og== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y0w6MnW3oZvs4i15UPLA0/120XiFldb3t4/pTdGFLw0=; b=aI9N71FzZIZRKxXvcwiSAqyB6Rq76cJLxCo0PhG00ZVuDS7cNYXTrJI2I9Qbi8TfFr m3Q6bQQqt7EJgBNcKblSjwYwKBiBcyB/eLeyEReLzB10nI/ufbrvdJriynlRCcTu+DV+ 4l5U3PZ1DuDzcX2gTQqa5IgkzF5P29JxxFXFW+Xb3dF76bp2AadoWGQh9n+ZLZN6GXS5 wmiWHG5D3BDZpXT9vVbud2W5As5F8OTxSAiO9QafEEC9pRgxEIpUlxA/faGQ0Dn2AmDC zhURaFhPRPJWyp0Ar8Dkc+KE5U49fdY4hqUzv2c1MtWG3g8nXITyvnwEPD5rQ7RY4ZMA 3CXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E6CVo+lY; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 z23si2523528otk.166.2019.12.11.23.53.56; Wed, 11 Dec 2019 23:53:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=E6CVo+lY; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1728157AbfLLHxz (ORCPT + 10 others); Thu, 12 Dec 2019 02:53:55 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43629 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728186AbfLLHxh (ORCPT ); Thu, 12 Dec 2019 02:53:37 -0500 Received: by mail-wr1-f66.google.com with SMTP id d16so1570581wre.10 for ; Wed, 11 Dec 2019 23:53:36 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=y0w6MnW3oZvs4i15UPLA0/120XiFldb3t4/pTdGFLw0=; b=E6CVo+lYFHxy1yyahd2inU7r/9j3l2DqXTlgipfrVkba/Jl2TfefTcPbRpdk8V0joZ RrByorq//rGjnAx9dl6Ds8d1hVHQMVMJhvfdTct0nw8PWLMrJaKjYptNvapLIHAVomiz htwxe3N2JqfqGEKKiwiKorD6j6mdVm2KOQ0LcE2wIhLBC95mCMriqAdgeqfUuFHLYPRG W2nGPHGhJftyqpmKGwVDVn2lyCd5W+kjHCKKGS2g/LmLrLlb6lKDCxtXaXGsTF1cPYXR Yf9L/yBYDWcK+0GKQScCuQCENTeoDQoNRHAP1miPGeCYcuScpp8xi3XL/JJ+p+ctcJ0W z9vg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=y0w6MnW3oZvs4i15UPLA0/120XiFldb3t4/pTdGFLw0=; b=WpFIwKfgazpiO6cJElscunKCwEgyrGJe3G8f8MrCBLJDUNSoRfQzd4nwoaPadH/oE4 V9vJ3vjDAkcYcht1m/8Et7mzTBPcr5Cub6AJT2t0j96ieSXzmnbAyII3nDUTIRn8+ZRh 9YB2lz/dNKkAOBS26dSuwuqiT4TwTtmNwMghIop+tpUfKNOhvHOtnvFC4HFZEu6st2Rn z3z1kpij9rl1H1tWydXHITeFbijn/85YDtKS4HnszTqQ50fP9qBFO23Vqvro8m5nbywO GaKR49jN3sSGG9GZktLTFZV9MH9a+cmmdkn8XZP/joZCxea2bzFbhM56N8CHlceGBLEg Ft4A== X-Gm-Message-State: APjAAAVNlaVO7jvZEIHzpTx5GpoY8K+aSj5ckh2W5HZaq/aRdyZluT6Y xrmKiggBhLTL2xy3sOqlcDqXgg== X-Received: by 2002:a5d:5708:: with SMTP id a8mr4838423wrv.79.1576137215643; Wed, 11 Dec 2019 23:53:35 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id x6sm5636742wmi.44.2019.12.11.23.53.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Dec 2019 23:53:35 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Georgi Djakov , Dmitry Osipenko , Bjorn Andersson , stable@vger.kernel.org Subject: [PATCH 2/4] interconnect: qcom: sdm845: Walk the list safely on node removal Date: Thu, 12 Dec 2019 09:53:30 +0200 Message-Id: <20191212075332.16202-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191212075332.16202-1-georgi.djakov@linaro.org> References: <20191212075332.16202-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Reviewed-by: Bjorn Andersson Signed-off-by: Georgi Djakov Cc: # v5.3+ --- 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); }