public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] cxl: fix return value in cxlctl_validate_set_features()
@ 2025-05-28  8:11 Dan Carpenter
  2025-05-28 15:22 ` Alison Schofield
  2025-06-09 16:39 ` Dave Jiang
  0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2025-05-28  8:11 UTC (permalink / raw)
  To: Shiju Jose
  Cc: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Li Ming, Fan Ni, linux-cxl,
	linux-kernel, kernel-janitors

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.

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-09 16:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-06-09 16:14     ` Ira Weiny
2025-06-09 16:39 ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox