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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h6j1ev5j.fsf@kurt.kurt.home>
Date: Thu, 25 Jan 2024 08:20:40 +0100
From: Kurt Kanzenbach <kurt@...utronix.de>
To: Simon Horman <horms@...nel.org>
Cc: Jesse Brandeburg <jesse.brandeburg@...el.com>, Tony Nguyen
 <anthony.l.nguyen@...el.com>, Vinicius Costa Gomes
 <vinicius.gomes@...el.com>, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
 Abeni <pabeni@...hat.com>, intel-wired-lan@...ts.osuosl.org,
 netdev@...r.kernel.org, Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
 Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH v1 iwl-next] igc: Add support for LEDs on i225/i226

On Wed Jan 24 2024, Simon Horman wrote:
> On Wed, Jan 24, 2024 at 09:24:08AM +0100, Kurt Kanzenbach wrote:
>
> ...
>
>> +static int igc_led_hw_control_set(struct led_classdev *led_cdev,
>> +				  unsigned long flags)
>> +{
>> +	struct igc_led_classdev *ldev = lcdev_to_igc_ldev(led_cdev);
>> +	struct igc_adapter *adapter = netdev_priv(ldev->netdev);
>> +	bool blink = false;
>> +	u32 mode;
>> +
>> +	if (flags & BIT(TRIGGER_NETDEV_LINK_10))
>> +		mode = IGC_LEDCTL_MODE_LINK_10;
>> +	if (flags & BIT(TRIGGER_NETDEV_LINK_100))
>> +		mode = IGC_LEDCTL_MODE_LINK_100;
>> +	if (flags & BIT(TRIGGER_NETDEV_LINK_1000))
>> +		mode = IGC_LEDCTL_MODE_LINK_1000;
>> +	if (flags & BIT(TRIGGER_NETDEV_LINK_2500))
>> +		mode = IGC_LEDCTL_MODE_LINK_2500;
>> +	if ((flags & BIT(TRIGGER_NETDEV_TX)) ||
>> +	    (flags & BIT(TRIGGER_NETDEV_RX)))
>> +		mode = IGC_LEDCTL_MODE_ACTIVITY;
>
> Hi Kurt,
>
> I guess this can't happen in practice,
> but if none of the conditions above are met,
> then mode is used uninitialised below.

Yes, it shouldn't happen, because the supported modes are
checked. However, mode can be initialized to off to avoid the warning.

>
> Flagged by Smatch.

Out of curiosity how did you get the warning? I usually run `make W=1 C=1
M=...` before sending patches.

Thanks,
Kurt

Download attachment "signature.asc" of type "application/pgp-signature" (862 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ