coredump: call KFD_IOC_DBG_TRAP_DISABLE in error path.
KFD assumes kfd_dbg_trap_enable/disable be called in pair, or there will be kfd_process ref leak in KFD.
This commit is contained in:
committed by
Zhang, Yifan
orang tua
afe7965796
melakukan
ccd91bcd19
@@ -127,6 +127,7 @@ struct NoteSegmentBuilder : public SegmentBuilder {
|
||||
std::unique_ptr<void, decltype(std::free) *> runtime_info(runtime_ptr, std::free);
|
||||
|
||||
if (HSAKMT_CALL(hsaKmtGetVersion(&versionInfo))) {
|
||||
HSAKMT_CALL(hsaKmtDbgDisable());
|
||||
fprintf(stderr, "Failed to fetch driver ABI version.\n");
|
||||
return HSA_STATUS_ERROR;
|
||||
}
|
||||
@@ -140,6 +141,7 @@ struct NoteSegmentBuilder : public SegmentBuilder {
|
||||
note_package_builder_.Write<uint64_t>(runtime_size);
|
||||
|
||||
if (HSAKMT_CALL(hsaKmtDbgGetDeviceData(&agents_ptr, &n_entries, &entry_size))) {
|
||||
HSAKMT_CALL(hsaKmtDbgDisable());
|
||||
fprintf(stderr, "Failed to fetch agents snapshot.\n");
|
||||
return HSA_STATUS_ERROR;
|
||||
}
|
||||
@@ -151,6 +153,7 @@ struct NoteSegmentBuilder : public SegmentBuilder {
|
||||
note_package_builder_.Write<uint32_t>(entry_size);
|
||||
|
||||
if (HSAKMT_CALL(hsaKmtDbgGetQueueData(&queues_ptr, &n_entries, &entry_size, true))) {
|
||||
HSAKMT_CALL(hsaKmtDbgDisable());
|
||||
fprintf(stderr, "Failed to fetch queues snapshot.\n");
|
||||
return HSA_STATUS_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user