Fix a bug that fmm_init_process_apertures() returns incorrect value
If opening drm render device fails (usually when the user is not a member of video group), fmm_init_process_apertures() still returns success, resulting in weird segfault in a later stage. Change-Id: Ifbde4481629988944ad7f384d59753c88e287fa9 Signed-off-by: Yong Zhao <yong.zhao@amd.com>
Bu işleme şunda yer alıyor:
+5
-3
@@ -1704,11 +1704,13 @@ HSAKMT_STATUS fmm_init_process_apertures(unsigned int NumNodes)
|
||||
|
||||
/* Skip non-GPU nodes */
|
||||
if (gpu_id != 0) {
|
||||
gpu_mem[gpu_mem_count].drm_render_fd =
|
||||
open_drm_render_device(props.DrmRenderMinor);
|
||||
if (gpu_mem[gpu_mem_count].drm_render_fd <= 0)
|
||||
int fd = open_drm_render_device(props.DrmRenderMinor);
|
||||
if (fd <= 0) {
|
||||
ret = HSAKMT_STATUS_ERROR;
|
||||
goto sysfs_parse_failed;
|
||||
}
|
||||
|
||||
gpu_mem[gpu_mem_count].drm_render_fd = fd;
|
||||
gpu_mem[gpu_mem_count].gpu_id = gpu_id;
|
||||
gpu_mem[gpu_mem_count].local_mem_size = props.LocalMemSize;
|
||||
gpu_mem[gpu_mem_count].device_id = props.DeviceId;
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle