Skip to content

Commit 2ed4160

Browse files
committed
Fix issue with get_device_uuid that fails to copy the UUID when the nv_rm_control call returns successfully due to a reversed check.
1 parent db234df commit 2ed4160

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/direct/nv-driver.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,15 @@ bool get_device_uuid(const NVDriverContext *context, uint8_t uuid[16]) {
329329
NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID_FLAGS_TYPE_SHA1
330330
};
331331
const int ret = nv_rm_control(context->nvctlFd, context->clientObject, context->clientObject, NV0000_CTRL_CMD_GPU_GET_UUID_FROM_GPU_ID, 0, sizeof(uuidParams), &uuidParams);
332-
if (ret) {
333-
return false;
334-
}
332+
if (ret == 1) {
333+
for (int i = 0; i < 16; i++) {
334+
uuid[i] = uuidParams.gpuUuid[i];
335+
}
335336

336-
for (int i = 0; i < 16; i++) {
337-
uuid[i] = uuidParams.gpuUuid[i];
337+
return true;
338338
}
339339

340-
return true;
340+
return false;
341341
}
342342

343343
// Query memory architecture via RM control.

0 commit comments

Comments
 (0)