Skip to content

Commit 5c9be3b

Browse files
authored
Apply suggestions from code review
1 parent 1fbecb1 commit 5c9be3b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

loader/icd.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ void khrIcdDeinitialize(void) {
544544
#if defined(CL_ENABLE_LAYERS)
545545
// free layers first in reverse order of their creation (front to back)
546546
// they may still need to use vendors while terminating
547-
KHR_ICD_TRACE("Finalizing and unloading layers\n");
547+
KHR_ICD_TRACE("finalizing and unloading layers\n");
548548
struct KHRLayer *head = khrFirstLayer;
549549
deinitLayer.dispatch = khrDeinitDispatch;
550550
khrFirstLayer = &deinitLayer;
@@ -555,7 +555,13 @@ void khrIcdDeinitialize(void) {
555555
free(cur->libraryName);
556556
#endif
557557
if (cur->p_clDeinitLayer)
558-
cur->p_clDeinitLayer();
558+
{
559+
cl_int res = cur->p_clDeinitLayer();
560+
if (CL_SUCCESS != res)
561+
{
562+
KHR_ICD_TRACE("error reported in layer deinitialization\n");
563+
}
564+
}
559565
if (!khrDisableLibraryUnloading)
560566
khrIcdOsLibraryUnload(cur->library);
561567
head = cur->next;
@@ -564,7 +570,7 @@ void khrIcdDeinitialize(void) {
564570
#endif // defined(CL_ENABLE_LAYERS)
565571

566572
// free vendor in reverse order of their creation (back to front)
567-
KHR_ICD_TRACE("Finalizing and unloading vendors\n");
573+
KHR_ICD_TRACE("finalizing and unloading vendors\n");
568574
while (lastVendor) {
569575
KHRicdVendor *cur = lastVendor;
570576
free(cur->suffix);

0 commit comments

Comments
 (0)