From patchwork Mon Aug 26 05:49:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13777103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C403C5321D for ; Mon, 26 Aug 2024 05:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=r2i8zaE0YtzEZow2QdSxGHYtA7tYlYZ9iUN/peY1qCA=; b=upHzPBPlbtPQ/UE7R/Xt+N88N8 /bRWiiveJmKFD7dtJRK6yeiSdcsZ2mJ4s7/WNGn8eiqqBdFddbgXW51ITsRFlLNPmZ4tHKoZXaAEA /dq2gF/2Jfub1lP24r5wBmKT75PkGkFbZ1g0vlNSWzkNP0hInPkuRO2Wx6EytTFXmQ1rb8+RtgZRj dEoQas0o+TyjAQo/Aiw8maAD+bsgypQwko2wYjDXbOpLxaKer51qhwlsSTJPZrrJ9R4ZsoyJoScoT O+iSQ3Q24Sp4VjrO6oEDzPwbUZH+sqZ9AgzD3xszCOLu9R9QYQ43TeeTi5vmh6eeCnboOPVfjy2gS txylhWpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siScc-00000005vRH-1tPR; Mon, 26 Aug 2024 05:50:34 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siSbp-00000005vIo-0cSB for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 05:49:46 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4281ddd3ae8so1534165e9.2 for ; Sun, 25 Aug 2024 22:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724651383; x=1725256183; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=r2i8zaE0YtzEZow2QdSxGHYtA7tYlYZ9iUN/peY1qCA=; b=li94LkPpsQnWHpSbAerzO9W8kGnXiMkJdI8TmE6gM1IUXxRaXSntcyhL8CZ224FP4d 3rLawuKWT20XoTa9Hha+4VDEHBB3e2Tpca+aJhJseotXgxdQhVQwk12GzQmAv5etsAyg D7PKk6bVkHPq9ETxUMl9ZfeB5x7+dQRhKqyrVUFcGh+cRJtZdc0nU6qsmZqHGmoN5NRJ DeCGpfqFM3s+PWpc/Jv1iD0J7du9GcUnSxfwjAHRopZbziVr5LfedplIh97LQR8WwY6G qWC0wKuHtTjzDXAe8DV61FDMS4CaktOVei18vKHk4anDoyms6A1Jee5O/lilGMHibOst fR5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724651383; x=1725256183; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r2i8zaE0YtzEZow2QdSxGHYtA7tYlYZ9iUN/peY1qCA=; b=QSGPVosnW9oRQKhScnuHH2v+bK5Z8P+ZK339HnarLNcAtsZwKHpOo2PmOqKOIaXeHr fglOnnYSNYhoivw9C+WdjVygdg5++ezDdv/bvYJ1IyEEYbRLbmVGI+wUKvyO97h5VO/V 0GAYxNADmUAuk64CtIb8mEafkVNfo9xPJC81sHIL6i2SGYszxDM98lwSum4j/Q6NenXc F/6QtoTR8DbMwNEKezKNRM/sSeKc4W9iQWC4oZv4YftOcdaKCnmJt6sXk4v9pF1wYCFl mH+524DgcVweLm+frs0joWXtoa01X73LfH/s1WBiQ4SsQZmx0IRChWTJVkAOdP0SD2Y7 ANUQ== X-Forwarded-Encrypted: i=1; AJvYcCWzkDSHSepJtFpqn2aMUIrNpInBht8co7fky0Brs8OLu4TT9ORzkPRY9CYnNj+10f9zIxvMO+LTuFDUDYnsk5ee@lists.infradead.org X-Gm-Message-State: AOJu0YzPPaO2N5U5vrFj/lBknr+FsVdHU/FMHRrACUFPRnrSEx9VsmgU 5g4+SFtfy6resAcs3yXAe9KplmA4v3tjA7wUwnx6USkWrYdB3E+G9vu9FR2Kbvk= X-Google-Smtp-Source: AGHT+IHE6P4oD3s3P8wsBrvk15qfQgG2eaRUaX3kBBUATpxHS5epKJAsXSqueKmZp/eKXkCcEt0ANA== X-Received: by 2002:a5d:5f48:0:b0:35f:2584:76e9 with SMTP id ffacd0b85a97d-37311852317mr3885621f8f.2.1724651383043; Sun, 25 Aug 2024 22:49:43 -0700 (PDT) Received: from krzk-bin.. ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42abee8d1c9sm177632025e9.23.2024.08.25.22.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 22:49:42 -0700 (PDT) From: Krzysztof Kozlowski To: Linus Walleij , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/2] ARM: versatile: fix OF node leak in CPUs prepare Date: Mon, 26 Aug 2024 07:49:33 +0200 Message-ID: <20240826054934.10724-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_224945_238112_ED092680 X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Machine code is leaking OF node reference from of_find_matching_node() in realview_smp_prepare_cpus(). Fixes: 5420b4b15617 ("ARM: realview: add an DT SMP boot method") Signed-off-by: Krzysztof Kozlowski Acked-by: Liviu Dudau --- Not Cc-ing stable as this should have almost no impact, except code correctness. --- arch/arm/mach-versatile/platsmp-realview.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-versatile/platsmp-realview.c b/arch/arm/mach-versatile/platsmp-realview.c index 6965a1de727b..d38b2e174257 100644 --- a/arch/arm/mach-versatile/platsmp-realview.c +++ b/arch/arm/mach-versatile/platsmp-realview.c @@ -70,6 +70,7 @@ static void __init realview_smp_prepare_cpus(unsigned int max_cpus) return; } map = syscon_node_to_regmap(np); + of_node_put(np); if (IS_ERR(map)) { pr_err("PLATSMP: No syscon regmap\n"); return; From patchwork Mon Aug 26 05:49:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13777104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 113D7C5321D for ; Mon, 26 Aug 2024 05:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MR544WKpOrPO2hZEA827PkxB0Gw4Fd6mIICwFvWkUJc=; b=3CSXC8acdZsP+PTlRRVGRTGBtv uRvW2yO1dXMTOw46rWyOhogZuJHsyFezYq7CXqQMQEa3PliHdaTRmuHh9EaN9H0RNpXciPjuwcL1F QEld9PFB0iXKZqvXiats3eytkqp/whuCQdUdUSrfSzi10bUJZAuYcNGt9XMA05Scps9JGLCY8ODuU tj0OBlEu2W1nSAweHXpSrHphaz31BJp9e4dttBuxN9XfmC1HyxgJfyyUKm/zH+bwEPbLBqTgsgQeL lxJgAZ2Z7rUBf8DXa8KoPoOjLH9nHHyi0975iPQzvEN9/Or0/anyvo+Rt3rzoUKq9aALDYCUJc5hf 8JE2tmUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siSdL-00000005vab-19QG; Mon, 26 Aug 2024 05:51:19 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siSbq-00000005vJ4-38yG for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 05:49:47 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-428e09ee91eso4828765e9.3 for ; Sun, 25 Aug 2024 22:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724651385; x=1725256185; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MR544WKpOrPO2hZEA827PkxB0Gw4Fd6mIICwFvWkUJc=; b=r3djWj/krUxF2UJWR0BsDtCfervCccsWO3WPr+vR2FM0CSfhN8+95Zl6WytXDn6VLL vYkMxyFO/ZRVS0o8Crjs4oTbJU2NwnqpC4vNvqEIFdHhmFhH8iAvc6IqlfgK+VulhrFF ifr8V79CxVk2l/5FwAYWzYS5H5f+MJBWPHFauNbLx1IameAB2zGVBe8Kg6kLazHkVA2y mORRDPyFS1fN50tTRC/l/23WglOh4gcTNobp1i6RUCBoNA9hFJReBPwuxfcLPfoqg3C6 AwTgn/EQq5Jjs/v7ih186OxSYc2PS6Fl3IKwEBz/hmSXl+GEgblx6w3+ze96XG5AE97G VtBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724651385; x=1725256185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MR544WKpOrPO2hZEA827PkxB0Gw4Fd6mIICwFvWkUJc=; b=LZh/roqWvQUvpIZ2xxyknus5gf/XzdJoPyF+e0CvGD9gojKidrdYNYK3fS+c5op3FQ rMPMXlpu8eiIm1HSNHmrfzHgdfa20UY6dXlRJHetcnbXHoCTlC/2FhZo9s90R8wdr9J3 tUOmWwUI4w4OkPqcmiQe3X7RdjJMBAGSvazEgsEvKsdre+xZjy6hFdjgxZryhHdVos8U WXOAQFtmeSUlVu4f7xLPtbe6p0GwsYP/5wZQSbQvMjUeGuxA5y8FQ/LeKz5SettIfCJG +/Rf5tAN36UY5nezLemY7pzKiTLHnhNEpODoBgIdoSIqgDQo/xg4smfKDlERuC6XzRF/ m+Ew== X-Forwarded-Encrypted: i=1; AJvYcCXZ1Wox6XHDLlpm9yXcSL6PdG4NB2AfnRgehjUOt2v4Ert1N4r6v/a/11KXjKkW8u8BFg6xnO5kNR0z5/YATujf@lists.infradead.org X-Gm-Message-State: AOJu0Yws93XxVh98YOL8J6UUntRpSRsBmND6UplSMwAQTh8boOvHGRhA 8TJoHEeWLVs0uZ5jRaguSiiKzqsC0Oenx8fJT02oobUTlMnltVxPV39Kx1Swnhk= X-Google-Smtp-Source: AGHT+IEecqCwvbndqp+gcmElYdt1+EyzERIKZxtyAUJ5mLigfVv6d+/9h3V0MQ7J7rvWLhlJWRf9+Q== X-Received: by 2002:a05:600c:1c1f:b0:427:9f71:16ba with SMTP id 5b1f17b1804b1-42acca112admr37662125e9.5.1724651384702; Sun, 25 Aug 2024 22:49:44 -0700 (PDT) Received: from krzk-bin.. ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42abee8d1c9sm177632025e9.23.2024.08.25.22.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 22:49:44 -0700 (PDT) From: Krzysztof Kozlowski To: Linus Walleij , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH 2/2] bus: integrator-lm: fix OF node leak in probe() Date: Mon, 26 Aug 2024 07:49:34 +0200 Message-ID: <20240826054934.10724-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240826054934.10724-1-krzysztof.kozlowski@linaro.org> References: <20240826054934.10724-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_224946_809147_DA231137 X-CRM114-Status: GOOD ( 11.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Driver code is leaking OF node reference from of_find_matching_node() in probe(). Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules") Cc: Signed-off-by: Krzysztof Kozlowski Acked-by: Liviu Dudau --- drivers/bus/arm-integrator-lm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c index b715c8ab36e8..a65c79b08804 100644 --- a/drivers/bus/arm-integrator-lm.c +++ b/drivers/bus/arm-integrator-lm.c @@ -85,6 +85,7 @@ static int integrator_ap_lm_probe(struct platform_device *pdev) return -ENODEV; } map = syscon_node_to_regmap(syscon); + of_node_put(syscon); if (IS_ERR(map)) { dev_err(dev, "could not find Integrator/AP system controller\n");