Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: f76e0bbc8bc3 ("cxl: Update prototype of function get_support_feature_info()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: https://patch.msgid.link/aDbFPSCujpJLY1if@stanley.mountain
Signed-off-by: Dave Jiang <dave.jiang@intel.com>

authored by

Dan Carpenter and committed by
Dave Jiang
87b42c11 19272b37

+1 -1
+1 -1
drivers/cxl/core/features.c
··· 544 544 u32 flags; 545 545 546 546 if (rpc_in->op_size < sizeof(uuid_t)) 547 - return ERR_PTR(-EINVAL); 547 + return false; 548 548 549 549 feat = cxl_feature_info(cxlfs, &rpc_in->set_feat_in.uuid); 550 550 if (IS_ERR(feat))