Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6791474ybc; Thu, 28 Nov 2019 05:36:06 -0800 (PST) X-Google-Smtp-Source: APXvYqx8WDevhMH72pLJdHu2zVWIBM0AFUetHKAOYF+JARK6/U38ngpLr3/f6nEq5iJqqBJse1Pa X-Received: by 2002:a17:906:2508:: with SMTP id i8mr41753589ejb.323.1574948165907; Thu, 28 Nov 2019 05:36:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574948165; cv=none; d=google.com; s=arc-20160816; b=WICDXpjUvmRhcfa6BZyEAH6bBx3r4F9bqD2LG8jTJxSIFB02aQIegMyfEaK13BxkX1 7LYv8AN83xgX/OhO9L4LQ+v8ozr14A12RDv8JICqum4ygN0WvAKSfsUwfQK2QT2HuPcc 1YdUWG/hi/1ycLMHHcUcN+Gd2ClVgIU1E0DJInkwkL/pvq79Xkw612MLUHfjnocbajBt 3W4B7XJPtcS/GDywTeD5YZF2Xyu0KkO3xGmse0A2LKRvWLTEAQiVzd2hYG4ppDpqsI35 H0nyT0oB+DX2tb32D/YkOm3zGLB+9fXajoA03uOGrk2GMFUctSOOYkgfcs5X3osq+mjQ ha2A== 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=/SDaimtx4qvfQT+a77LcPCR1TXpL+CTCSqALSHB4+Rg=; b=LFOlNpw91k3IeciYx3N9k8dG66ELo0nZMg+HvV7z8fMigpjO+rcQnoITAO8ZcFP4YO DdAu0aNFpy+nGIt11PsjnQGQApOe79IEzVOM753+1G2kNwZmGXIJBkgOrKDumfAldK4x dZlcnIfRk9pf1B3cBV2ZvtUuuGWp3fPoPVB7UHH9zKXO4jyaoCZPKy9Sd/Kk7Tqaf6yo keDrNdCiPWQWwdJx1BU1LM9vgAdQowvqpeIpgpy1SEYU6tNo0zo8bkb82vH5ZfLsCNE1 WGk6bDCLw2DvFyRgLP5DqaSEUQvSTadA8M4vg4OfI4oQzvg37upMfSO4Cc6YHRVPFyNU m6Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fKWoGZnU; 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 n22si11874934ejx.53.2019.11.28.05.35.41; Thu, 28 Nov 2019 05:36:05 -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=fKWoGZnU; 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 S1726715AbfK1Nej (ORCPT + 99 others); Thu, 28 Nov 2019 08:34:39 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54723 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfK1Nei (ORCPT ); Thu, 28 Nov 2019 08:34:38 -0500 Received: by mail-wm1-f66.google.com with SMTP id b11so10939740wmj.4 for ; Thu, 28 Nov 2019 05:34: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=/SDaimtx4qvfQT+a77LcPCR1TXpL+CTCSqALSHB4+Rg=; b=fKWoGZnUHc0AEupO0e6BxYnAvJWsF4R3vlQfEGVemUrT1VmzmBVuRcs3pYHh1i022b gHmZKlDlHLPDLKLOFB31mC+7L1exI346izL/6cLcwo2keOu59Zw/hKq7Fx1iS2FOTJZD mrE7l2joW729IcshdEEbg8w+u5mfrT3HexEs7L86uvd6tZlm29ugtWvQDcHsUeUURYYj vsec6EgQjjsV+Rn7koKFXTjcMr42HpbtZsEwcA5vxEIBbyymZfRIf9MWFdoWveRAa2xJ y+FhU5PfevlbWXY3k+t9i7MqLgHUKy5Tn5QeNyyX0XO1UTS1j6uaZCNiWEMOzFGkdVX5 970Q== 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=/SDaimtx4qvfQT+a77LcPCR1TXpL+CTCSqALSHB4+Rg=; b=A9xtlnpkLsxA3FFD05b9mI7p38RRC56oIOx+x0yKJyreJDWo01YDbJdnicPqK5japN TPoQ/iAVhGz6Kx8RBXASutJSyb1BY1XbndHZFk/eAjBjEJafP0CLXqssC496xj/xI5q5 s23IUl51zBYGopXTfWonS9uKbnGeMChNr9Q8MHSXmhU8gyeu3YqvxdGcoqBKkK58QF8x 3HNjM2OXyaH6J7yBbgGNNbj60x7AkiFVQnE08ELEX1i3n9lQpuJy313g2Up2cEBPA97p JbwWvAaYdrEv/9Yc7hiXextWN7QO5Kqjk4jRWjZcMz7QQFjPXwO5NLngq5lYWue13viP i3nQ== X-Gm-Message-State: APjAAAWwBX0Q9AykPzlen1/C71EWI97k6LQc5mf2fSzD842faCGAXvna bjTuiFAyRhT++dMQlCEd5oMQ8A== X-Received: by 2002:a1c:23d5:: with SMTP id j204mr9329041wmj.0.1574948077036; Thu, 28 Nov 2019 05:34:37 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y20sm2220451wmi.25.2019.11.28.05.34.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Nov 2019 05:34:36 -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 1/5] interconnect: qcom: sdm845: Walk the list safely on node removal Date: Thu, 28 Nov 2019 15:34:31 +0200 Message-Id: <20191128133435.25667-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- drivers/interconnect/qcom/sdm845.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c index 502a6c22b41e..924c2d056d85 100644 --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -870,7 +870,7 @@ static int qnoc_remove(struct platform_device *pdev) struct icc_provider *provider = &qp->provider; struct icc_node *n; - list_for_each_entry(n, &provider->nodes, node_list) { + list_for_each_entry_safe(n, &provider->nodes, node_list) { icc_node_del(n); icc_node_destroy(n->id); }