RE: [PATCH next] cxl: fix return value in cxlctl_validate_set_features()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: Alison Schofield <alison.schofield@xxxxxxxxx>
>Sent: 28 May 2025 16:23
>To: Shiju Jose <shiju.jose@xxxxxxxxxx>; Dan Carpenter
><dan.carpenter@xxxxxxxxxx>
>Cc: Davidlohr Bueso <dave@xxxxxxxxxxxx>; Jonathan Cameron
><jonathan.cameron@xxxxxxxxxx>; Dave Jiang <dave.jiang@xxxxxxxxx>; Vishal
>Verma <vishal.l.verma@xxxxxxxxx>; Ira Weiny <ira.weiny@xxxxxxxxx>; Dan
>Williams <dan.j.williams@xxxxxxxxx>; Li Ming <ming.li@xxxxxxxxxxxx>; Fan Ni
><fan.ni@xxxxxxxxxxx>; linux-cxl@xxxxxxxxxxxxxxx; linux-
>kernel@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx
>Subject: Re: [PATCH next] cxl: fix return value in cxlctl_validate_set_features()
>
>On Wed, May 28, 2025 at 11:11:41AM +0300, Dan Carpenter wrote:
>> The cxlctl_validate_set_features() function is type bool.  It's
>> supposed to return true for valid requests and false for invalid.
>> However, this error path returns ERR_PTR(-EINVAL) which is true when
>> it was intended to return false.
>
>Shiju - Can you trace this one through and add the impact statement?
>Wondering if this is going to fail gracefully, or badly, further down this path?

Hi Alison,

This is introduced when following fwctl specific code
move out of common  function (use both in fwctl and edac path)
get_support_feature_info() to fwctl specific function
cxlctl_validae_set_feature().
"if (rpc_in->op_size < sizeof(uuid_t))
      return ERR_PTR(-EINVAL);"

This may have an impact on fwctl side if the above check pass.

Thanks,
Shiju

>
>>
>> Fixes: f76e0bbc8bc3 ("cxl: Update prototype of function
>> get_support_feature_info()")
>> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>> ---
>>  drivers/cxl/core/features.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c
>> index 6f2eae1eb126..7c750599ea69 100644
>> --- a/drivers/cxl/core/features.c
>> +++ b/drivers/cxl/core/features.c
>> @@ -544,7 +544,7 @@ static bool cxlctl_validate_set_features(struct
>cxl_features_state *cxlfs,
>>  	u32 flags;
>>
>>  	if (rpc_in->op_size < sizeof(uuid_t))
>> -		return ERR_PTR(-EINVAL);
>> +		return false;
>>
>>  	feat = cxl_feature_info(cxlfs, &rpc_in->set_feat_in.uuid);
>>  	if (IS_ERR(feat))
>> --
>> 2.47.2
>>






[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux