[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <F2FBADE8-EDF9-4987-A97B-CF4D2D1452E0@inria.fr>
Date: Thu, 21 Mar 2024 16:20:09 -0400
From: Julia Lawall <Julia.Lawall@...ia.fr>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Dan Carpenter <dan.carpenter@...aro.org>, kernel-janitors@...r.kernel.org,
netdev@...r.kernel.org, intel-wired-lan@...ts.osuosl.org,
Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
Alexander Lobakin <aleksander.lobakin@...el.com>,
David Laight <David.Laight@...lab.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Jiri Pirko <jiri@...nulli.us>, Jonathan Cameron <jic23@...nel.org>,
Kees Cook <keescook@...omium.org>,
Lukasz Czapnik <lukasz.czapnik@...el.com>, Paolo Abeni <pabeni@...hat.com>,
Pucha Himasekhar Reddy <himasekharx.reddy.pucha@...el.com>
Subject: Re: [PATCH net] ice: Fix freeing uninitialized pointers
Does one prefer an initialization of null at the top of the function or an initialization to a meaningful value in the middle of the function ?
(Sorry for top posting)
Sent from my iPhone
> On 21 Mar 2024, at 14:14, Markus Elfring <Markus.Elfring@....de> wrote:
>
>
>>
>>> How do you think about to reduce the scope for the affected local variable instead
>>> with the help of a small script (like the following) for the semantic patch language?
>>>
>>> @movement@
>>> attribute name __free;
>>> @@
>>> -u8 *tx_frame __free(kfree);
>>> int i;
>>> ... when any
>>> if (ice_fltr_add_mac(test_vsi, ...))
>>> { ... }
>>> +
>>> +{
>>> +u8 *tx_frame __free(kfree) = NULL;
>>> if (ice_lbtest_create_frame(pf, &tx_frame, ...))
>>> { ... }
>>> ... when any
>>> +}
>>> +
>>> valid_frames = ice_lbtest_receive_frames(...);
>>
>> I believe you don't understand what the scope of the above can be.
>
> Will the understanding improve for the proposed source code transformation?
>
> Regards,
> Markus
Powered by blists - more mailing lists