Check errno rather than return from kmtIoctl in hsaKmtRuntimeEnable.

The return code is just -1 if any error occurs.  To detect debugger
unavailable we need to check the actual ioctl error code.

Change-Id: I8a294c754196aec916809497ec8e810da2f072b8
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
此提交包含在:
Sean Keely
2021-09-30 03:08:06 -05:00
父節點 f82927ad65
當前提交 b67bc6fcc9
+1 -1
查看文件
@@ -324,7 +324,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtRuntimeEnable(void *rDebug,
long err = kmtIoctl(kfd_fd, AMDKFD_IOC_DBG_TRAP, &args);
if (err) {
if (err == EBUSY)
if (errno == EBUSY)
return HSAKMT_STATUS_UNAVAILABLE;
else
return HSAKMT_STATUS_ERROR;