Skip to content

Commit

Permalink
fix: CXL host exerciser segmentation fault non-root user mode (#3067) (
Browse files Browse the repository at this point in the history
…#3070)

-CXL host exerciser segmentation fault occurs in non-root user mode,
  exit application if clx device open fails.

Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
  • Loading branch information
anandaravuri committed Jan 5, 2024
1 parent 5860743 commit e21332e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions samples/cxl_host_exerciser/he_cache_test.h
Expand Up @@ -435,7 +435,7 @@ class afu {
logger_->debug("DFH + 16: 0x:{0:X}", *(u64 + 2));
logger_->debug("DFH + 24: 0x:{0:X}", *(u64 + 3));

return exit_codes::not_run;
return exit_codes::success;
}

int main(int argc, char *argv[]) {
Expand Down Expand Up @@ -474,7 +474,8 @@ class afu {
}

int res = open_handle(dev_path_[dev_index].c_str());
if (res != exit_codes::not_run) {
if (res != exit_codes::success) {
cerr << "Failed to open cxl device" << endl;
return res;
}

Expand Down

0 comments on commit e21332e

Please sign in to comment.