Skip to content

Commit 87b42c1

Browse files
Dan Carpenterdavejiang
authored andcommitted
cxl: fix return value in cxlctl_validate_set_features()
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. The incorrect return will result in kernel failing to prevent a incorrect op_size passed in from userspace to be detected. [ dj: Add user impact to commit log ] Fixes: f76e0bb ("cxl: Update prototype of function get_support_feature_info()") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent 19272b3 commit 87b42c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cxl/core/features.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ static bool cxlctl_validate_set_features(struct cxl_features_state *cxlfs,
544544
u32 flags;
545545

546546
if (rpc_in->op_size < sizeof(uuid_t))
547-
return ERR_PTR(-EINVAL);
547+
return false;
548548

549549
feat = cxl_feature_info(cxlfs, &rpc_in->set_feat_in.uuid);
550550
if (IS_ERR(feat))

0 commit comments

Comments
 (0)