From nobody Mon Feb 9 01:17:12 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98CA415B3 for ; Sat, 2 Mar 2024 00:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709340743; cv=none; b=HQVoC/bgKgdWCP3SkG3KE3A4emfcc3eI/SYZEl7zpeHcDFgmOtIhC0BzKviE7y0TxoIMkU+mPAvBd2Q+TlMzI3kt7kHrzMzPO0kiFsG2brFQmD1gt8PsD1B7eaKteuPwN9uztH+lGANEYK56cdTXshWGolZp+LFU2Dq38zEKj5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709340743; c=relaxed/simple; bh=i9zNt6rOlk75HZazBVwuQFbrGUUh1ujpF0qjhh1iKXA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IXZAgvtfWJh6KJb9dtLk16A1dW20ch+2lehJs8nRIePmSiOCJ/V9llMUzufZ11uvBMWmvlKhYSDZjXNkoQsp4QG04x0HpnC7OYvxdGHIcQ+FVYXyNEvZEJX95Wm/3b97XYomz8sY+31qYkBxSGIvfpWwvILWoCtJyXyUYtsm5ZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ciwdgtcx; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ciwdgtcx" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-412d29057a9so726335e9.1 for ; Fri, 01 Mar 2024 16:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709340740; x=1709945540; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/abXWgtHmlIb9XxgX5gbRZA6M3LUdmvdJ04zpHwkRbw=; b=Ciwdgtcxa/fSIwfjDv5PEpnA12SP3Ng9piagaR7l7Ovt6t65i3JcZOvJqi/zFXd29D b71KOEy3u2LsjJFBCCJRlM8pH7oe6DSv3KW68ycHfPxaIenn2tq3MBfDGeefdR9SFfhx tw3QZtzDdma3CBg6Ucj8l3+a/H7jDXEABjR2BUZ2fsc+dNoZmO4+XsgPQNKobxKKh9ld 4NCIJfHOTrlvqKdTengK9/okDZjvdrSwhALXHhvgiZdYTVYK4ESkbh6VPxa91ufNVi/+ p1jQg6C9VVudSqxgOxZYa5ZTiTR2uTaeyFdA8/8PzZ47iqyy4G4vRZM1o2msMKo2eRyy kboQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709340740; x=1709945540; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/abXWgtHmlIb9XxgX5gbRZA6M3LUdmvdJ04zpHwkRbw=; b=ncF67h+OVuLVYGVE+4+LF+4BltV6h8hrEvC3cu9pdc85QP6ngEFwxCmbCeJeD/xKMZ thOaqk2GnA51ktW8a1NoLwttymSUjCS/GL2RM8uGciYV/87cvMW5o150uFul5enuRFNI gHvHL144OeclB6wK23pIzgYm1ZSHUz8BdwyL1cKZlZnQl/gM5mhYZh6EP0+Ukoutlkf0 d4SOsmLwiPRV1iDG7yayfZPwTaO9EaEREd1hO4c7JlmqpLP2KHUp/xlJyhVDlphs7q10 HpspleRr4YJ2meaT+r3JpSS9U9/0hIQJoi2p0ZGlFGEDp5Bv9yMMiKszSJeamCJbnpm0 7jBA== X-Forwarded-Encrypted: i=1; AJvYcCWCVczW6dNCUi56oreu5vqIsZF/QgoarkWiz1pWQm+/tyUmpWSjXfL3YmviC+PBPtFuFExoYAcuft7sDrrM/1qr48E+FN6eVDQxp1br X-Gm-Message-State: AOJu0YzERZYoN/qLRJvGfyF3SsbqxxjnTBS1uflKb+81BbLo9CaSbCM8 cuRIyJydlGOfICoHISmk1x1sc9aeMxZvE8qEG0X5KiCH6gkKg3qeFc5G5j1pskM= X-Google-Smtp-Source: AGHT+IFf6kIIxmFIowOq9kVezM+FJdAj6mvoHaDA7SDas70k/1wBH2ROYjcRSmBpd7FsWaBYTtjDew== X-Received: by 2002:a05:600c:4448:b0:412:b0d3:49d9 with SMTP id v8-20020a05600c444800b00412b0d349d9mr3246722wmn.9.1709340739907; Fri, 01 Mar 2024 16:52:19 -0800 (PST) Received: from [127.0.1.1] ([176.61.106.68]) by smtp.gmail.com with ESMTPSA id f15-20020adffccf000000b0033dedd63382sm5865501wrs.101.2024.03.01.16.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 16:52:19 -0800 (PST) From: Bryan O'Donoghue Date: Sat, 02 Mar 2024 00:52:14 +0000 Subject: [PATCH 1/2] clk: Fix clk_core_get NULL dereference Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240302-linux-next-24-03-01-simple-clock-fixes-v1-1-25f348a5982b@linaro.org> References: <20240302-linux-next-24-03-01-simple-clock-fixes-v1-0-25f348a5982b@linaro.org> In-Reply-To: <20240302-linux-next-24-03-01-simple-clock-fixes-v1-0-25f348a5982b@linaro.org> To: Michael Turquette , Stephen Boyd , Bjorn Andersson , Konrad Dybcio , Rajendra Nayak , Abel Vesa Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14-dev It is possible for clk_core_get to dereference a NULL in the following sequence: clk_core_get() of_clk_get_hw_from_clkspec() __of_clk_get_hw_from_provider() __clk_get_hw() __clk_get_hw() can return NULL which is dereferenced by clk_core_get() at hw->core. Prior to commit dde4eff47c82 ("clk: Look for parents with clkdev based clk_lookups") the check IS_ERR_OR_NULL() was performed which would have caught the NULL. Reading the description of this function it talks about returning NULL but that cannot be so at the moment. Update the function to check for hw before dereferencing it and return NULL if hw is NULL. Fixes: dde4eff47c82 ("clk: Look for parents with clkdev based clk_lookups") Signed-off-by: Bryan O'Donoghue --- drivers/clk/clk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index a3bc7fb90d0f..25371c91a58f 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -418,6 +418,9 @@ static struct clk_core *clk_core_get(struct clk_core *c= ore, u8 p_index) if (IS_ERR(hw)) return ERR_CAST(hw); =20 + if (!hw) + return NULL; + return hw->core; } =20 --=20 2.43.0 From nobody Mon Feb 9 01:17:12 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F2A75660 for ; Sat, 2 Mar 2024 00:52:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709340744; cv=none; b=duK0bI54aQyTAI9ds3EeeffAG4LCCeSG54KCErKuZYoT1WLeXlEkaHCtI44l+Z1y3JeGpo74CCkuUa3kSnLW8QY7cCoQrpzQnQckqKztTyarHqt0a69EJUCcIrbZi+Bdofnr49ytPTqXcAyRp5dzj1IjDHrNz9fjDHHhA+3C3SM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709340744; c=relaxed/simple; bh=5KcsPf2NXDTosjt6TxYIEZuVyoCBWIEzwcJCEsZMh14=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UroRhq/Yg2xpZ81++gYBz/MY96UbOaK/oWTE6XDSnlVOgveXTYjYg8QHEZO/MnXogSUbb+8fZgB/4Lo52VcI3Ux/Zj/8JgIsk3G5Ti6rRcBzn76u2fvleXCGXaStk0lNICkw4MW1CapavZ9lHM3ZjlVGfnHcCQWfjgimqeuByDs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Fu/l1l89; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Fu/l1l89" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-33d568fbf62so1341905f8f.3 for ; Fri, 01 Mar 2024 16:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709340741; x=1709945541; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=epHJKobVDJjhahUPHFVdoDFlUlvBfNFMXFrew87gMLQ=; b=Fu/l1l89CnZlijJnxS0I4KyLWrlvc48EU0pgiB+X13fV3KBCnIiHe+68bx6qCFD7gx wUZj7GG7YO7pyTulu9Rh5ScpdcugSkvIRn8RriRs/2WkM0dVJcNVGJEZ6HeGPKvEabyW hQHuZCXIZMawyDQWuJ46GA7PkejCKCRZv22JdtyICgWtWWmMChSYsDfS4J2KybM8BZlw bvh6tHqbDZMyoHV2VLVyzLDqROGK3U2j9q/C41gJZCAV0lkVcMNKwduGK5wWaEWkV67C 0QwDlhAx2hW0pCV6uwFOOw7SvSmCYLotEffu00K6cfRBsMOvgJUiPZMfz3GU9+sJjWF7 X3Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709340741; x=1709945541; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=epHJKobVDJjhahUPHFVdoDFlUlvBfNFMXFrew87gMLQ=; b=SeqsKQwVtmor2ybvTPmve4ozNfGpvL/C7VtHwTKjF9KajUnpAg9e45xNzrJFYVyeCP Zn8UfHJYlTDAr93+pJaqgTXsaQTMzY9BMftj7edIodq9699fupJWuPqFa+tvzNVSK/Yn l5aXQ24g7SOFOUrIbgEnZTwUqDEV8zhmSUbrV908xb1R9PitGGMkfBFiYLoCfmneMRED 5FEcfnzwigZiZrBG6IGP4DrnFt6CR/zqnaMQlwXRuPxgeumVsEVOaNhmT++rGikG48RE 9BOVqa28uYTyb1m28hK9cCjFZPGp/fiO79mtBBWR+i/pl8mfKaaQFYPKlqfOk8RTYp8H PkSg== X-Forwarded-Encrypted: i=1; AJvYcCUp6MaO2+WtuQjkr8RddKxTRR5DgAsTeIcQl8SUmTVjuBxzeUr4DPWaXui8v8KzfyIINMu7IinXNCT2QLs28bRLJx2ktF2RJiHuTvqm X-Gm-Message-State: AOJu0YyVCWzRV/xz8NvZ+RHd0RwIOdH3F+km7Z8x1X8KQYSLwSYufhjh JozEAupNj8mRkQ9OUBdpiun79JyuCF1LkiNGYg0HB0JGirqhBwRx/XI+VVTNi3g= X-Google-Smtp-Source: AGHT+IEZB89IozKw4cjqKVIKyH5c1bwWK8g37ziiO6UL1ZXHdGBpR5lru1AtvgB13K9uvzoUE1Co6g== X-Received: by 2002:adf:db50:0:b0:33d:afbc:6c85 with SMTP id f16-20020adfdb50000000b0033dafbc6c85mr2953106wrj.8.1709340741649; Fri, 01 Mar 2024 16:52:21 -0800 (PST) Received: from [127.0.1.1] ([176.61.106.68]) by smtp.gmail.com with ESMTPSA id f15-20020adffccf000000b0033dedd63382sm5865501wrs.101.2024.03.01.16.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 16:52:20 -0800 (PST) From: Bryan O'Donoghue Date: Sat, 02 Mar 2024 00:52:15 +0000 Subject: [PATCH 2/2] clk: qcom: camcc-x1e80100: Fix missing DT_IFACE enum in x1e80100 camcc Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240302-linux-next-24-03-01-simple-clock-fixes-v1-2-25f348a5982b@linaro.org> References: <20240302-linux-next-24-03-01-simple-clock-fixes-v1-0-25f348a5982b@linaro.org> In-Reply-To: <20240302-linux-next-24-03-01-simple-clock-fixes-v1-0-25f348a5982b@linaro.org> To: Michael Turquette , Stephen Boyd , Bjorn Andersson , Konrad Dybcio , Rajendra Nayak , Abel Vesa Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14-dev The desired DT pattern for clock indexing is the following: clocks =3D <&gcc GCC_CAMERA_AHB_CLK>, <&bi_tcxo_div2>, <&bi_tcxo_ao_div2>, <&sleep_clk>; In order to facilitate that indexing structure we need to have DT_IFACE enum defined. Fixes: 76126a5129b5 ("clk: qcom: Add camcc clock driver for x1e80100") Signed-off-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio --- drivers/clk/qcom/camcc-x1e80100.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/qcom/camcc-x1e80100.c b/drivers/clk/qcom/camcc-x1e= 80100.c index f7f3d92c263d..46bb225906bf 100644 --- a/drivers/clk/qcom/camcc-x1e80100.c +++ b/drivers/clk/qcom/camcc-x1e80100.c @@ -21,6 +21,7 @@ #include "reset.h" =20 enum { + DT_IFACE, DT_BI_TCXO, DT_BI_TCXO_AO, DT_SLEEP_CLK, --=20 2.43.0