From patchwork Mon Dec 16 17:48:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 181780 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4664419ile; Mon, 16 Dec 2019 10:15:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxk7j1eUGfzbtTyuLpaCMYAQ9DLOA/yEwhjjRUWkT0dRsp4c0cZbZ6h3xqtH/RhMd7AoRv9 X-Received: by 2002:a9d:3677:: with SMTP id w110mr27230603otb.139.1576520149682; Mon, 16 Dec 2019 10:15:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576520149; cv=none; d=google.com; s=arc-20160816; b=UT4VAo3Bq61hoIopQD77qCq5uT1ucS/3Zet2r2+nBnX13WJlcZLrYtXQX8/Cdr0Eg1 acN6HLDZzxWilYrgzbmjVgej72XCTVL6UKol8zrDia5YoQsmqE1pAAY9s9r6XPf+80I4 aDjpcSULXMSN+irMTLTPFq6O3ZsuWo9bxvnNlgvJoUxxejYJOe6RYvMRJ5+Zp6f9WXJx /0iSIxr2iUzsxoHzacU9Ztbl7+BfUO+nC0oDva/aeLNsF4CTl2nc7bQHvxxugPDg8KPB 9o/RNsazVtkvwEXzPkDTPGnTYPiTKW8Sp7o8Jjt1g7MtTJ+EPsq0mmdAlNQfZLkhLp2+ veIg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5qzGNrqeYmF5az6W1zLRq9O51eI3ByAnVA2nmhYBHeI=; b=AJQ1VC3Cqxs3yI5gqUB/h+a9JLSedQlWI6E0FhPtOYA8aXcMi0nZeGKXWIqbniCus/ Sw4OVzQ3UNEkWw0suH4V9g0j95g7sMG1yh0LjceZVZ6Z+bWq4dTfSNUoXMn2QIX4Vnvg 1dLJ7fRE7bJeNZUJZ2X33v+bY+svDYL72YnGxkuwcuFjGXXD1GyZOOzA3kt8ZY1ztCO3 yhnFDy5AQdu2OigWp0uRpQC1MSpBP+uuUeSbjWO8kY11ohWSJbZhNX6Rp+3F6cGJNMLS o1uwsAl/KQlJz33pmd3NwlV2iKA2M1DbdCEZsRzNB3mp3QTdCR/DYZW4dRXcjpDoJx0f m7qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XIRok3IZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si11178741otq.28.2019.12.16.10.15.49; Mon, 16 Dec 2019 10:15:49 -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=@kernel.org header.s=default header.b=XIRok3IZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731434AbfLPSPs (ORCPT + 27 others); Mon, 16 Dec 2019 13:15:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:37216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731423AbfLPSPp (ORCPT ); Mon, 16 Dec 2019 13:15:45 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B909206E0; Mon, 16 Dec 2019 18:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576520144; bh=p/wBT6mWqigW85wIsm9D/fhIeRga+NgjGzKYgeSLtn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XIRok3IZ3MhfvbcuU3t1n6QipUTVIIHslY7MTXu8TLXWF+4CTtWtUikon6CpR3W11 Wg9yW9GGwN6MNNBWNRxu06z2KE2h+h1cCS21hHBd+JE6WnK9zbOiknsg863LpCwQkA cUFmWTjG4pRE3epE2jCLCXkS/1Gfzt4SZ4cJv9yg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Osipenko , Bjorn Andersson , Georgi Djakov Subject: [PATCH 5.4 033/177] interconnect: qcom: sdm845: Walk the list safely on node removal Date: Mon, 16 Dec 2019 18:48:09 +0100 Message-Id: <20191216174826.474653116@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174811.158424118@linuxfoundation.org> References: <20191216174811.158424118@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Georgi Djakov commit b29b8113bb41285eb7ed55ce0c65017b5c0240f7 upstream. 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+ Link: https://lore.kernel.org/r/20191212075332.16202-3-georgi.djakov@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/interconnect/qcom/sdm845.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -868,9 +868,9 @@ static int qnoc_remove(struct platform_d { 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); }