From patchwork Thu Dec 12 07:53: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: 11287161 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FB7D14BD for ; Thu, 12 Dec 2019 07:53:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F36624654 for ; Thu, 12 Dec 2019 07:53:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="a4AiFZYK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728194AbfLLHxh (ORCPT ); Thu, 12 Dec 2019 02:53:37 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38218 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728153AbfLLHxg (ORCPT ); Thu, 12 Dec 2019 02:53:36 -0500 Received: by mail-wr1-f65.google.com with SMTP id y17so1603923wrh.5 for ; Wed, 11 Dec 2019 23:53:35 -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=V2BxefIfBzald1w3B2qVq4/Mnrw+MpcEMXquUNshwCQ=; b=a4AiFZYKsCKuIL2IwNdbbxZROXHMrl0otYb2KrvVl67D12pLPV5ToyhpKan9Lxwtah zH1gICMj5/TgwKYMz8rWYAhYkLvFbaPf+luFG2MN5OByqzHGjLFCO6jUb1mHIpFKSV0u NenALf80YXM6faIkMBsbpQTDtBl9DXbMpEN68aCSq3LQnsHuReU6Jw9N95tQCefPGNlc PBwSpPEIKTCZpv1jsB83030xy8Q3KSxZSEkCYRXBDp+AL3DLG+hO7GJISuPb1F7idq1g vTM4t4sbLHCvOFISPXgWfKf7PE8DxMboCIjJgetj1XObhZqr3gaP/61Kfxs4QR8I97/Y cwWQ== 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=V2BxefIfBzald1w3B2qVq4/Mnrw+MpcEMXquUNshwCQ=; b=gvbKZFnubL8rEeeaB8O45N7zObZSfKHJD7vFm9XQfV9Hnu7CHFenUhb/PNaoZHx1gT leM8quzcvEq0zSwL1X0kaBdtDtFLMeJTVedhnIUBEEfuJn+ysUTO3eM5xSidycPo9zvl JlLP+CcJDZky0z3MGyXEzZZXdNKOFvP+2FrIlQe9HJWgkg8wmk3r357LtZ9mr+XDQZI3 ZjVI0sJRYk6Yx7BM+SvUWFY+dd4HaGx+Sp7oUp7ZQsqbfb0UNCjpAi496hJvFKQJVYJy Q2OdYj+cPllII8hx6/2WzfZhmJE8uk07hKM7Ofeviij31/O0f1S/CdPt9LNlgQ3XsigI zMAA== X-Gm-Message-State: APjAAAV6WqQTYNas2//+pz6i1CDhNvGcj18dnybufBl60G9xUg1y7PoX /YAhQxTcnkDL1/rMUhXM3p5pZw== X-Google-Smtp-Source: APXvYqy0OeAvvpsa5iPv/x2SAjzroaVo9o7GLOwqpo+4emy6BPTE1Ec+48oc85wlwUtDJCgR0SQcww== X-Received: by 2002:a5d:6b82:: with SMTP id n2mr4544132wrx.153.1576137214539; Wed, 11 Dec 2019 23:53:34 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id x6sm5636742wmi.44.2019.12.11.23.53.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Dec 2019 23:53:34 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Georgi Djakov Subject: [PATCH 1/4] interconnect: qcom: Fix Kconfig indentation Date: Thu, 12 Dec 2019 09:53:29 +0200 Message-Id: <20191212075332.16202-2-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 From: Krzysztof Kozlowski Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/Kconfig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/interconnect/qcom/Kconfig b/drivers/interconnect/qcom/Kconfig index c49afbea3458..2f9304d1db49 100644 --- a/drivers/interconnect/qcom/Kconfig +++ b/drivers/interconnect/qcom/Kconfig @@ -6,13 +6,13 @@ config INTERCONNECT_QCOM Support for Qualcomm's Network-on-Chip interconnect hardware. config INTERCONNECT_QCOM_MSM8974 - tristate "Qualcomm MSM8974 interconnect driver" - depends on INTERCONNECT_QCOM - depends on QCOM_SMD_RPM - select INTERCONNECT_QCOM_SMD_RPM - help - This is a driver for the Qualcomm Network-on-Chip on msm8974-based - platforms. + tristate "Qualcomm MSM8974 interconnect driver" + depends on INTERCONNECT_QCOM + depends on QCOM_SMD_RPM + select INTERCONNECT_QCOM_SMD_RPM + help + This is a driver for the Qualcomm Network-on-Chip on msm8974-based + platforms. config INTERCONNECT_QCOM_QCS404 tristate "Qualcomm QCS404 interconnect driver" 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: 11287163 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EF8214BD for ; Thu, 12 Dec 2019 07:53:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D99D24658 for ; Thu, 12 Dec 2019 07:53:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="E6CVo+lY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728157AbfLLHxz (ORCPT ); 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-Google-Smtp-Source: APXvYqwytfBf126ULinW5oFqdBQeWvCz2VVUAU2XhFKvinoMG4AvjJx0JLgTIa8YEq6lsKANcL889Q== 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); } From patchwork Thu Dec 12 07:53: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: 11287159 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B698138C for ; Thu, 12 Dec 2019 07:53:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39CD224654 for ; Thu, 12 Dec 2019 07:53:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kuBwZF3a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728099AbfLLHxt (ORCPT ); Thu, 12 Dec 2019 02:53:49 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33497 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728188AbfLLHxj (ORCPT ); Thu, 12 Dec 2019 02:53:39 -0500 Received: by mail-wr1-f67.google.com with SMTP id b6so1640796wrq.0 for ; Wed, 11 Dec 2019 23:53: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=/ok0nQnxyVp+hWourd2iRYkQMDbNDd797Oi+3MDLgvE=; b=kuBwZF3aTUHamxKahISgDPfpkTVxpBWPErTUxDu8tvilS/xaRc3rm9NfU4I6x4KXsZ ZstbdCSaaVFHD07vHcFFvZRa6afY74PXr4bIkBz7g3Tlel5xeUfBh1nGCq4vaGK1US5W EPmSF9L41f5LHog3fQib1Q3H4aTGpyh1uQn5pLKvx5bday1E3nvG8tXShjGW507ItW4X dHMRdOEhHXXNCmKe8jA6j4ZxIec/a2dDFUPoLSeCc/kcwNXRlE3cmUXidsrOcFLm3Wss 0Vfrm+hMFh/WZF3hckaFO9jIIEklzubZWt7sSLrhO8VjiS9j/gPtkwA2/cWqiJhfs32i NoZQ== 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=/ok0nQnxyVp+hWourd2iRYkQMDbNDd797Oi+3MDLgvE=; b=WXWGaEEovLBRf2TNBysrb0qf8iRTX+m4USrjouztfcTZfmruW+glinZqP9XGWb9535 vZ0gQuUYlSO70dlgqLlap2Gu+7tKvxzSWVkKHpyhlDA/Kszj7OsXmfMp+HZkKNdv/1gl cgGIOC9YNccQeipC+OzRgLxOp4aBxyzklBkFQGZlAF+k+i7WoXEGRp7PjljD+hc46BOW aKJmEXBQBdcqmZWejMSwLLEPlfku+I6WHRVP5OLDYVfdVy3egOamzhqaS5SRJ95OT0Ud mXvYFYPNP7wEo1VHvPxUJEzzNMfY1TqpBrREHXxno0/t7/viTZpaDgT6YjafedXSNrf5 4CHw== X-Gm-Message-State: APjAAAUfXHio+s0Uq9JIYGiIqgzYI+AzqK8e6cRp+upvwMjxzAFuH+yp OJTbL/cR5AAUktkbcLEZFs5vrg== X-Google-Smtp-Source: APXvYqzPziPpJRFVzoBFwbFJvLDT14cwri/geZerVfDTVoysW08yVdQwFE9ukJgLmSRP+uRdNA+GFA== X-Received: by 2002:adf:f10a:: with SMTP id r10mr4623170wro.202.1576137216719; Wed, 11 Dec 2019 23:53:36 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id x6sm5636742wmi.44.2019.12.11.23.53.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Dec 2019 23:53:36 -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 3/4] interconnect: qcom: qcs404: Walk the list safely on node removal Date: Thu, 12 Dec 2019 09:53:31 +0200 Message-Id: <20191212075332.16202-4-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: 5e4e6c4d3ae0 ("interconnect: qcom: Add QCS404 interconnect provider driver") Reported-by: Dmitry Osipenko Reviewed-by: Bjorn Andersson Signed-off-by: Georgi Djakov Cc: # v5.4 --- drivers/interconnect/qcom/qcs404.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index b4966d8f3348..8e0735a87040 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -414,7 +414,7 @@ static int qnoc_probe(struct platform_device *pdev) struct icc_provider *provider; struct qcom_icc_node **qnodes; struct qcom_icc_provider *qp; - struct icc_node *node; + struct icc_node *node, *tmp; size_t num_nodes, i; int ret; @@ -494,7 +494,7 @@ static int qnoc_probe(struct platform_device *pdev) return 0; err: - list_for_each_entry(node, &provider->nodes, node_list) { + list_for_each_entry_safe(node, tmp, &provider->nodes, node_list) { icc_node_del(node); icc_node_destroy(node->id); } @@ -508,9 +508,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); } From patchwork Thu Dec 12 07:53:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 11287157 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A4E314BD for ; Thu, 12 Dec 2019 07:53:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28A4E2467A for ; Thu, 12 Dec 2019 07:53:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Kr+KUFJN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728191AbfLLHxl (ORCPT ); Thu, 12 Dec 2019 02:53:41 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38224 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbfLLHxj (ORCPT ); Thu, 12 Dec 2019 02:53:39 -0500 Received: by mail-wr1-f65.google.com with SMTP id y17so1604106wrh.5 for ; Wed, 11 Dec 2019 23:53:38 -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=L7tBmXs8szR5coP2QPrIYVtp6Vuz4hm1y2XfuDFevyM=; b=Kr+KUFJNBXKZ6arLp7UE3PERZN82b7n76/zlZDLkUpneYqY1PlQefWZYnLdmknkRl9 HoH8gkaIpCmD33VV4YTrIflwwLBELrHVheSzqqa3J/PWyeLNzGzVGQPqU9HRUPP7QC2O Fr4dwQfTrmWSmrX+OuF3XbJUOUO7OJt0ANf+89QLKhqt5huFkZnT0vF0Qgn2Sa5B1bf9 pqMhCG/4EanSoyZpSC5X/H2FLj6SPEeyBlBGBctaWcXeKOhGOiEy8dR74wZbsciAEQLW bNka3AnfcEA+razqnulyyZDR9SLHWBVDWbjBqegStGryfu/Km6BBERbAp1Wpj0YWk7Nn fmAA== 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=L7tBmXs8szR5coP2QPrIYVtp6Vuz4hm1y2XfuDFevyM=; b=KtjXbWTQGt5Ui1HevFth9vKpgqK2FfxH6Rs9FBWqYFR72jbqhj6myaqNpEeHngzLus /d6eoNoDMNHGk6QuTF/FdXkIp860Ua9dAhN66X0+N/014pYVvvsEv6D+mSJ4VWtzda3S eCQ6fmOz2kJMLwvyk6NsvYVRnAqsLuGNNYhMtq3+V4eyMJ8Q4Kj8trVX99dc5G46vB8G +TwBAwi4mV8QrPrkAi1qpn27Hj5xofRJtFxtQWujUt8EHIuaqTHlTskEUUrZGtgJASrg /wMj90+GQ5WMmQF1FvbCZNQU08GsHLnvxFM552/2UOu7aVFHEMXnyy2877Jvl0E+ztf+ 9Ckg== X-Gm-Message-State: APjAAAVueRnU0oMsPzaAquc42aWxddR0yOwd629+2dNSFIHLDOB+NwuF Mlb6ZWLXOJoNQNarZ0iWznELXw== X-Google-Smtp-Source: APXvYqwUcXHovOEUWwZs2zVMXRBYn/LxMi6Qcnji64Gr+n8eHVr8u6yV+0K7vpOXoZ6kWZzhfYl3Sw== X-Received: by 2002:a5d:53d1:: with SMTP id a17mr4430038wrw.327.1576137217821; Wed, 11 Dec 2019 23:53:37 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id x6sm5636742wmi.44.2019.12.11.23.53.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Dec 2019 23:53:37 -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 Subject: [PATCH 4/4] interconnect: qcom: msm8974: Walk the list safely on node removal Date: Thu, 12 Dec 2019 09:53:32 +0200 Message-Id: <20191212075332.16202-5-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: 4e60a9568dc6 ("interconnect: qcom: add msm8974 driver") Reported-by: Dmitry Osipenko Reviewed-by: Bjorn Andersson Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/msm8974.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/interconnect/qcom/msm8974.c b/drivers/interconnect/qcom/msm8974.c index ce599a0c83d9..bf8bd1aee358 100644 --- a/drivers/interconnect/qcom/msm8974.c +++ b/drivers/interconnect/qcom/msm8974.c @@ -652,7 +652,7 @@ static int msm8974_icc_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct icc_onecell_data *data; struct icc_provider *provider; - struct icc_node *node; + struct icc_node *node, *tmp; size_t num_nodes, i; int ret; @@ -732,7 +732,7 @@ static int msm8974_icc_probe(struct platform_device *pdev) return 0; err_del_icc: - list_for_each_entry(node, &provider->nodes, node_list) { + list_for_each_entry_safe(node, tmp, &provider->nodes, node_list) { icc_node_del(node); icc_node_destroy(node->id); } @@ -748,9 +748,9 @@ static int msm8974_icc_remove(struct platform_device *pdev) { struct msm8974_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); }