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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aTLDiK50Me-iNkdz@redhat.com>
Date: Fri, 5 Dec 2025 06:35:36 -0500
From: Brian Masney <bmasney@...hat.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: oe-kbuild@...ts.linux.dev, Michael Turquette <mturquette@...libre.com>,
	Stephen Boyd <sboyd@...nel.org>, Maxime Ripard <mripard@...nel.org>,
	Claudiu Beznea <claudiu.beznea@...on.dev>,
	Conor Dooley <conor@...nel.org>, lkp@...el.com,
	oe-kbuild-all@...ts.linux.dev, linux-clk@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] clk: microchip: core: allow driver to be compiled
 with COMPILE_TEST

On Fri, Dec 05, 2025 at 10:21:55AM +0300, Dan Carpenter wrote:
> smatch warnings:
> drivers/clk/microchip/clk-core.c:300 roclk_get_parent() warn: signedness bug returning '(-22)'
> drivers/clk/microchip/clk-core.c:833 sclk_get_parent() warn: signedness bug returning '(-22)'
> 
> vim +300 drivers/clk/microchip/clk-core.c
> 
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  286  static u8 roclk_get_parent(struct clk_hw *hw)
>                                                              ^^
> returns a u8.
> 
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  287  {
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  288  	struct pic32_ref_osc *refo = clkhw_to_refosc(hw);
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  289  	u32 v, i;
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  290  
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  291  	v = (readl(refo->ctrl_reg) >> REFO_SEL_SHIFT) & REFO_SEL_MASK;
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  292  
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  293  	if (!refo->parent_map)
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  294  		return v;
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  295  
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  296  	for (i = 0; i < clk_hw_get_num_parents(hw); i++)
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  297  		if (refo->parent_map[i] == v)
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  298  			return i;
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  299  
> ce6e11884659988 Purna Chandra Mandal 2016-05-13 @300  	return -EINVAL;
>                                                         ^^^^^^^^^^^^^^^
> So it can't return negative error codes.
> 
> ce6e11884659988 Purna Chandra Mandal 2016-05-13  301  }

This was an existing bug in the driver. Since I'm making changes
to this driver, I'll go ahead and fix this as well.

Brian


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ