Skip to content

Commit 879d76b

Browse files
committed
option PDA_SKIP_UNLOCK_FAILURE to release buffer even when unlock fails (RH9.5, O2)
1 parent ccb282d commit 879d76b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

arch/linux_x86_uio/dma_buffer_inc.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,16 @@ DMABuffer_free
863863
}
864864

865865
if(munlock(buffer->map, buffer->length) != 0)
866-
{ ERROR_EXIT( errno, exit, "Buffer unlocking failed!\n" ); }
866+
{
867+
#ifdef PDA_SKIP_UNLOCK_FAILURE
868+
#pragma message "*** Compiling with PDA_SKIP_UNLOCK_FAILURE"
869+
// report, but continue with release procedure even if unlock fails
870+
ERROR( errno, "Buffer unlocking failed! (but releasing)\n" );
871+
if(0) { goto exit; } // fake use of exit label to avoid compiler warning
872+
#else
873+
ERROR_EXIT( errno, exit, "Buffer unlocking failed!\n" );
874+
#endif
875+
}
867876

868877
buffer->map = MAP_FAILED;
869878
persistant = PDA_DELETE;

0 commit comments

Comments
 (0)