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>
This commit is contained in:
Sean Keely
2021-09-30 03:08:06 -05:00
parent f82927ad65
commit b67bc6fcc9
+1 -1
View File
@@ -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;