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] [thread-next>] [day] [month] [year] [list]
Message-ID: <a8cae5ad-8a2a-4752-a2cd-634c1746af8f@web.de>
Date: Mon, 4 Mar 2024 13:10:11 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Julia Lawall <julia.lawall@...ia.fr>, linux-input@...r.kernel.org,
 kernel-janitors@...r.kernel.org, Dmitry Torokhov
 <dmitry.torokhov@...il.com>, Jeff LaBundy <jeff@...undy.com>,
 Rob Herring <robh@...nel.org>,
 Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v2] Input: iqs626a - Use scope-based resource management
 in iqs626_parse_events()

>> Scope-based resource management became supported also for this software
>> area by contributions of Jonathan Cameron on 2024-02-17.
>>
>> device property: Add cleanup.h based fwnode_handle_put() scope based cleanup.
>> https://lore.kernel.org/r/20240217164249.921878-3-jic23@kernel.org
>>
>>
>> * Thus use the attribute “__free(fwnode_handle)”.
>>
>> * Reduce the scope for the local variable “ev_node” into a for loop.
…
>> +++ b/drivers/input/misc/iqs626a.c
>> @@ -462,7 +462,6 @@ iqs626_parse_events(struct iqs626_private *iqs626,
>>  {
>>  	struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg;
>>  	struct i2c_client *client = iqs626->client;
>> -	struct fwnode_handle *ev_node;
>>  	const char *ev_name;
>>  	u8 *thresh, *hyst;
>>  	unsigned int val;
>> @@ -501,6 +500,8 @@ iqs626_parse_events(struct iqs626_private *iqs626,
>>  		if (!iqs626_channels[ch_id].events[i])
>>  			continue;
>>
>> +		struct fwnode_handle *ev_node __free(fwnode_handle);
>
> Doesn't this need to be initialized?

This variable should usually be set in both branches of the subsequent if statement,
shouldn't it?

Please take another look at the proposed scope reduction
for the affected variable.
May additional curly brackets be omitted for this source code transformation?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ