From patchwork Thu Nov 28 13:34:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 180424 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp156813ile; Thu, 28 Nov 2019 05:34:44 -0800 (PST) X-Google-Smtp-Source: APXvYqxYMEDSQ24kTCEw+bCjgonGvrJhu26EcsHczDjlUcv4eaC9mjxx4+BFkz7aCuHcB6xlopp5 X-Received: by 2002:a17:906:7042:: with SMTP id r2mr54644224ejj.166.1574948084505; Thu, 28 Nov 2019 05:34:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574948084; cv=none; d=google.com; s=arc-20160816; b=rghWQZkAf9Ay56rDjjEqgjs4K2SbJpTkZztUnw64gkpoVjKlpSddO2gM7prnDQfOWD KhFC6964n6/SpOTdn13nJUaDkudokkdtT4+sBilc63zX84bz8ERuG66kt3sNJOLkebhY j++VsCwDxp30te7bObUAfXe3eJv3b3yZiFVplEDqWj2XYP0b6vmhp7nnbS5fnHFvtAyY 12JD7cKY/uNOyL+F4NxWqzk/uvYFGPVXJljg1c6AbB/WQDUCu2xMiVBYCZNbO0jp2o1X LE5PHGulUGSoAcc/IFJVm/tCjHWs80Bu+DdkBlN1EOxcx2FnW/s4BFQa+ZY82RbG6Zb8 RaGg== 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 lu2si11617386ejb.83.2019.11.28.05.34.43; Thu, 28 Nov 2019 05:34:44 -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 S1726723AbfK1Nej (ORCPT + 26 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 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(-) Reviewed-by: Bjorn Andersson 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); }