Skip to content

Commit 7470f81

Browse files
authored
fix device_fd validation
1 parent f1b8f78 commit 7470f81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driverapi/src/librecuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ memMapToCpu(LibreCUcontext ctx, NvHandle memoryHandle, size_t size, NvU64 &targe
346346
int device_fd;
347347
if (isSystemAlloc) {
348348
device_fd = open("/dev/nvidiactl", O_RDWR | O_CLOEXEC);
349-
LIBRECUDA_VALIDATE(fd_ctl != -1, LIBRECUDA_ERROR_INVALID_DEVICE);
349+
LIBRECUDA_VALIDATE(device_fd != -1, LIBRECUDA_ERROR_INVALID_DEVICE);
350350
} else {
351351
std::string device_file = getDeviceFile(ctx->device);
352352

0 commit comments

Comments
 (0)