lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250723102355.GJ3137075@e132581.arm.com>
Date: Wed, 23 Jul 2025 11:23:55 +0100
From: Leo Yan <leo.yan@....com>
To: hejunhao <hejunhao3@...wei.com>
Cc: Suzuki K Poulose <suzuki.poulose@....com>,
	Mike Leach <mike.leach@...aro.org>,
	James Clark <james.clark@...aro.org>,
	Anshuman Khandual <anshuman.khandual@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 04/10] coresight: Appropriately disable programming
 clocks

Hi,

On Mon, Jul 21, 2025 at 10:08:27PM +0800, hejunhao wrote:
> On 2025/6/27 19:51, Leo Yan wrote:
> > diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> > index 4ac65c68bbf44b98db22c3dad2d83a224ce5278e..dd2b4cc7a2b70cf060a3207548fe80e3824c489f 100644
> > --- a/include/linux/coresight.h
> > +++ b/include/linux/coresight.h
> > @@ -480,26 +480,16 @@ static inline bool is_coresight_device(void __iomem *base)
> >    * Returns:
> >    *
> >    * clk   - Clock is found and enabled
> > - * NULL  - clock is not found
> >    * ERROR - Clock is found but failed to enable
> >    */
> >   static inline struct clk *coresight_get_enable_apb_pclk(struct device *dev)
> >   {
> >   	struct clk *pclk;
> > -	int ret;
> > -	pclk = clk_get(dev, "apb_pclk");
> > -	if (IS_ERR(pclk)) {
> > -		pclk = clk_get(dev, "apb");
> > -		if (IS_ERR(pclk))
> > -			return NULL;
> Hi,
> 
> Here, the function returns NULL, but the caller uses IS_ERR() to check the
> function return value.
> Yes, this patch has already been fixed this, and should we split this fix
> into a separate patch?

I am not sure if I understand this question correctly.

Are you suggesting that we should use IS_ERR_OR_NULL() instead of
IS_ERR() to check the returned clock pointer?

If so, the answer is that we should not change it. As Suzuki mentioned,
we need to tolerate the absence of pclk in the ACPI case. So keep using
IS_ERR() is the right thing to do.

Thanks,
Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ