From: Shiju Jose <shiju.jose@huawei.com>
To: Alison Schofield <alison.schofield@intel.com>,
Dan Carpenter <dan.carpenter@linaro.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Dave Jiang <dave.jiang@intel.com>,
"Vishal Verma" <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
"Dan Williams" <dan.j.williams@intel.com>,
Li Ming <ming.li@zohomail.com>, Fan Ni <fan.ni@samsung.com>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH next] cxl: fix return value in cxlctl_validate_set_features()
Date: Wed, 28 May 2025 16:21:11 +0000 [thread overview]
Message-ID: <3cf2e87f32934c6d84ede6415206a352@huawei.com> (raw)
In-Reply-To: <aDcqO5hlGrRXzIPT@aschofie-mobl2.lan>
>-----Original Message-----
>From: Alison Schofield <alison.schofield@intel.com>
>Sent: 28 May 2025 16:23
>To: Shiju Jose <shiju.jose@huawei.com>; Dan Carpenter
><dan.carpenter@linaro.org>
>Cc: Davidlohr Bueso <dave@stgolabs.net>; Jonathan Cameron
><jonathan.cameron@huawei.com>; Dave Jiang <dave.jiang@intel.com>; Vishal
>Verma <vishal.l.verma@intel.com>; Ira Weiny <ira.weiny@intel.com>; Dan
>Williams <dan.j.williams@intel.com>; Li Ming <ming.li@zohomail.com>; Fan Ni
><fan.ni@samsung.com>; linux-cxl@vger.kernel.org; linux-
>kernel@vger.kernel.org; kernel-janitors@vger.kernel.org
>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@linaro.org>
>> ---
>> 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
>>
next prev parent reply other threads:[~2025-05-28 16:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 8:11 [PATCH next] cxl: fix return value in cxlctl_validate_set_features() Dan Carpenter
2025-05-28 15:22 ` Alison Schofield
2025-05-28 16:15 ` Dan Carpenter
2025-05-28 16:21 ` Shiju Jose [this message]
2025-06-09 16:14 ` Ira Weiny
2025-06-09 16:39 ` Dave Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3cf2e87f32934c6d84ede6415206a352@huawei.com \
--to=shiju.jose@huawei.com \
--cc=alison.schofield@intel.com \
--cc=dan.carpenter@linaro.org \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=fan.ni@samsung.com \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.li@zohomail.com \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox