Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp291048lqt; Thu, 6 Jun 2024 03:56:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTYRQqucDLnvrlOhbz5EU//DRHidFI4HG2Utplm1Q8BkcyNIB/ghNy6EEOEFNNr6xoSu4L99yGa59N3aAsZ+gx8AwlqtfTf6xT+gF/Yg== X-Google-Smtp-Source: AGHT+IH1P9O+j6viOsxR86HgsEZmRISW589MBEwWhL5BN+itKlZdWBKLhKaMoQu3Q3hTkjimuZka X-Received: by 2002:a17:906:3e55:b0:a68:9621:a938 with SMTP id a640c23a62f3a-a699f34a8demr328334866b.7.1717671371010; Thu, 06 Jun 2024 03:56:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717671370; cv=pass; d=google.com; s=arc-20160816; b=Q8j95J1hJfIGTifxAq6Yvx2KPhRnOiaYzJuGtLEtJUTSyLCjXGLp0nsz6uh8KYqbC5 MX2EvLmJKAPACL+8wJ0z2VY8nM0j8zb1o9RjmB1QvDiySvlIcOkSptVtU3GTrkPCfM2p Stid2hpldbVQ7+F4UpsEFt6z3ZRSspuWytvz3ruxHxup16oftbjz67g+IgupYI/gr+QP LUgyixWdXe6KyEIxPhECDcF+3X+Yq9buCzeAXea4BbYJl6kIOeghatA0kVtCeQPCWAZS Y5aLoq9xGTGu4FtWP2XIZv4X9Y5be9CgFpvAjFBkHTmlHGkkVxjoBe8saCTUrMQmY8hj JQVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ZU+eb0pwei1iFKJkDCTOqCoshqt3FMAFSy++brHsjm4=; fh=0StTjPMmm7GAFNDpU9fZE+Q98x7YJxvU6iclnOpmtes=; b=KqPrRohTaFCQF5GV+/n1OwI7TtXEPFlHSfoNWKAH7hAa92ivTT7KUrRVXcSMM5LFsd PKMAq3jLBQU6TKJSHP0VuFyS09z9EmI4vvYFwiK/CzH1fH+fS76eBWqRUXyiZGNnb5fN 3qxSlcLH4Ah54uAjm1QJyo5k7hkwDqEK1nG358oVjYvxvxWLi95R+8Ioi1Kc2HtO06xJ XaHtyRNK0PDirfuLTMy3JEkpnjRPyuTqSgzaDn4jQ0+KC0SsYmlOziTVPPKddB1eL5Px YLA/wdr0azy5DgG8dhmJwH8xbED2YyIcp78yLPam5IfW5xZc7hAJ4zMw0ZdTn/0y9ln/ uwcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="coLYoUY/"; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-204147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c806dbc8asi53022266b.367.2024.06.06.03.56.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:56:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="coLYoUY/"; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-204147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AB6611F272B1 for ; Thu, 6 Jun 2024 10:56:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E9A319539A; Thu, 6 Jun 2024 10:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="coLYoUY/" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F5AC2E639; Thu, 6 Jun 2024 10:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717671364; cv=none; b=BJZHTxGLDpzUJ3zevS8WN6L6OYNJ4ZMN5B2tzh7mw2BlkDH49EcJ3nLiaM/7MClz5Lc8KuqZ10Bzv5I7cb4ozeFLkbKtORfxxa2OdHYJnendn3+Ep4f0UxkcdiP/qyKFZuaeEpX+sEzrZW8qDOJMq8+PDCqQQaR9DVH0DYPxmfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717671364; c=relaxed/simple; bh=YgzEeSRn9SjAt09HXi0BbwcLxwl/BddzUZDCbdf390Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=W+vEGfW7jPllxyuYtN3b1xvMaWBSSW1z1JvQPdcu7V7TENkDVQbK5zX52oEsoqWyfFSmJJqyk6w9QXIa0XZCHJx8aqUD73APKoIYCLo3jekP924dJCqFdNB8RUmlCGESP87U1DO3UK66obPlmxRiHGMVXo4TeIfUCCBbp08+iWo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=coLYoUY/; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1717671359; bh=YgzEeSRn9SjAt09HXi0BbwcLxwl/BddzUZDCbdf390Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=coLYoUY//s6wa9jmOGWFcJFmosndgvzmNXIMsqq9uXubkcn9Y1qJ0Q3Z54G0FGq8K gC8CWJ+K/bcyFPUO8lGMxg0HkqTaa5Q9uuYSZ2nZz4osYQvM+vsUIjoncFnfsH/fpq 8yJKrhqg4PQ/fPAQwsugMQLJCSITrYhQZ+hOtGR61zKVYBp04JgvyIozX4yEHZ0g4C mCdZFludSE6yxpSnpFOhfP2WQmeKC30KpTQo3YSFLd8dIHOhnnUqPJUl2sYg//vJkU mSK+ExpYi1wQlHdMFZGr+kFGQgxhFqax5RkLoFzfjQ58vK8qMwtiS/cNVkhgnRMXJo mP5N6WKI7TCfw== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B29EB3780627; Thu, 6 Jun 2024 10:55:58 +0000 (UTC) Message-ID: <07664707-6482-4b17-91fd-251cf73cbee9@collabora.com> Date: Thu, 6 Jun 2024 12:55:57 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5.10/5.15/6.1] clk: mediatek: mt8183: Add memory To: Aleksandr Mishin , Weiyi Lu , stable@vger.kernel.org, Greg Kroah-Hartman Cc: Michael Turquette , Stephen Boyd , Matthias Brugger , Sasha Levin , Markus Schneider-Pargmann , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org References: <20240606103402.23912-1-amishin@t-argos.ru> From: AngeloGioacchino Del Regno Content-Language: en-US In-Reply-To: <20240606103402.23912-1-amishin@t-argos.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 06/06/24 12:34, Aleksandr Mishin ha scritto: > No upstream commit exists for this commit. > > The issue was introduced with commit c93d059a8045 ("clk: mediatek: mt8183: > Register 13MHz clock earlier for clocksource") > > In case of memory allocation fail in clk_mt8183_top_init_early() > 'top_clk_data' will be set to NULL and later dereferenced without check. > Fix this bug by adding NULL-return check. > > Upstream branch code has been significantly refactored and can't be > backported directly. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > There's no fixes tag, and the commit title shall be fixed, you're not "adding memory". Please fix - after which, it kind of makes sense to add this to stable. Cheers, Angelo > Signed-off-by: Aleksandr Mishin > --- > drivers/clk/mediatek/clk-mt8183.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/clk/mediatek/clk-mt8183.c b/drivers/clk/mediatek/clk-mt8183.c > index 78620244144e..8377a877d9e3 100644 > --- a/drivers/clk/mediatek/clk-mt8183.c > +++ b/drivers/clk/mediatek/clk-mt8183.c > @@ -1185,6 +1185,11 @@ static void clk_mt8183_top_init_early(struct device_node *node) > int i; > > top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK); > + if (!top_clk_data) { > + pr_err("%s(): could not register clock provider: %d\n", > + __func__, -ENOMEM); > + return; > + } > > for (i = 0; i < CLK_TOP_NR_CLK; i++) > top_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER);