Skip to content

Commit 25174d5

Browse files
MingLi-4davejiang
authored andcommitted
cxl/feature: Update out_len in set feature failure case
CXL subsystem supports userspace to configure features via fwctl interface, it will configure features by using Set Feature command. Whatever Set Feature succeeds or fails, CXL driver always needs to return a structure fwctl_rpc_cxl_out to caller, and returned size is updated in a out_len parameter. The out_len should be updated not only when the set feature succeeds, but also when the set feature fails. Fixes: eb5dfcb ("cxl: Add support to handle user feature commands for set feature") Signed-off-by: Li Ming <ming.li@zohomail.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://patch.msgid.link/20250410024521.514095-1-ming.li@zohomail.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent dc91567 commit 25174d5

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
@@ -528,13 +528,13 @@ static void *cxlctl_set_feature(struct cxl_features_state *cxlfs,
528528
rc = cxl_set_feature(cxl_mbox, &feat_in->uuid,
529529
feat_in->version, feat_in->feat_data,
530530
data_size, flags, offset, &return_code);
531+
*out_len = sizeof(*rpc_out);
531532
if (rc) {
532533
rpc_out->retval = return_code;
533534
return no_free_ptr(rpc_out);
534535
}
535536

536537
rpc_out->retval = CXL_MBOX_CMD_RC_SUCCESS;
537-
*out_len = sizeof(*rpc_out);
538538

539539
return no_free_ptr(rpc_out);
540540
}

0 commit comments

Comments
 (0)