Skip to content

Commit b099d59

Browse files
authored
Setup to return FPGA_ERR_FAIL in the unlikely case of afi_id mismatch after load. (#34)
1 parent ac3cf65 commit b099d59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdk/userspace/fpga_libs/fpga_mgmt/fpga_mgmt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ int fpga_mgmt_load_local_image_sync(int slot_id, char *afi_id,
263263
status = (ret == 0) ? tmp_info.status : FPGA_STATUS_END;
264264
if (status == FPGA_STATUS_LOADED) {
265265
/** Sanity check the afi_id */
266-
ret = strncmp(afi_id, tmp_info.ids.afi_id, sizeof(tmp_info.ids.afi_id));
266+
ret = (strncmp(afi_id, tmp_info.ids.afi_id, sizeof(tmp_info.ids.afi_id))) ?
267+
FPGA_ERR_FAIL : 0;
267268
fail_on(ret, out, "AFI ID mismatch: requested afi_id=%s, loaded afi_id=%s",
268269
afi_id, tmp_info.ids.afi_id);
269270
done = true;

0 commit comments

Comments
 (0)