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:
+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;
|
||||
|
||||
Reference in New Issue
Block a user