Skip to content

Commit 80a5529

Browse files
committed
levelzero: add missing calloc return value check
Signed-off-by: Tuomas Katila <[email protected]>
1 parent 9bd3975 commit 80a5529

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/gpu_levelzero/zes.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ static ze_result_t enumerate_zes_devices(void)
113113
}
114114

115115
zes_handles = calloc(count, sizeof(zes_device_handle_t));
116+
if (zes_handles == NULL) {
117+
return ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY;
118+
}
116119

117120
res = zesDeviceGet(handle, &count, zes_handles);
118121
if (res != ZE_RESULT_SUCCESS) {

0 commit comments

Comments
 (0)