[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <122bc3a2-2150-4661-8d08-2082e0e7a9d7@intel.com>
Date: Fri, 14 Mar 2025 13:52:58 +0100
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Dan Carpenter <dan.carpenter@...aro.org>, Matthew Wilcox
<willy@...radead.org>, Michal Swiatkowski
<michal.swiatkowski@...ux.intel.com>
CC: <netdev@...r.kernel.org>, <jiri@...nulli.us>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<horms@...nel.org>, <pierre@...ckhpc.com>, <hkallweit1@...il.com>,
<linux@...linux.org.uk>, <maxime.chevallier@...tlin.com>,
<christophe.leroy@...roup.eu>, <arkadiusz.kubalewski@...el.com>,
<vadim.fedorenko@...ux.dev>
Subject: Re: [PATCH net v2 0/3] fix xa_alloc_cyclic() return checks
On 3/14/25 11:23, Dan Carpenter wrote:
> On Wed, Mar 12, 2025 at 10:52:48AM +0100, Michal Swiatkowski wrote:
>> Pierre Riteau <pierre@...ckhpc.com> found suspicious handling an error
>> from xa_alloc_cyclic() in scheduler code [1]. The same is done in few
>> other places.
>>
>> v1 --> v2: [2]
>> * add fixes tags
>> * fix also the same usage in dpll and phy
>>
>> [1] https://lore.kernel.org/netdev/20250213223610.320278-1-pierre@stackhpc.com/
>> [2] https://lore.kernel.org/netdev/20250214132453.4108-1-michal.swiatkowski@linux.intel.com/
>>
>> Michal Swiatkowski (3):
>> devlink: fix xa_alloc_cyclic() error handling
>> dpll: fix xa_alloc_cyclic() error handling
>> phy: fix xa_alloc_cyclic() error handling
>
> Maybe there should be a wrapper around xa_alloc_cyclic() for people who
> don't care about the 1 return?
What about changing init flags instead, and add a new one for this
purpose?, say:
XA_FLAGS_ALLOC_RET0
>
> int wrapper()
> {
> ret = xa_alloc_cyclic();
> if (ret < 0)
> return ret;
> rerturn 0;
> }
>
> regards,
> dan carpenter
>
Powered by blists - more mailing lists