Page MenuHomeFreeBSD

Don't leak lock from os_kmem_alloc().
ClosedPublic

Authored by jhb on Aug 15 2017, 11:33 PM.

Details

Summary

The current port patches for os_kmem_alloc() add VM object locking.
However, the lock is not unlocked in the success case because the
unlock code is inside of an if body instead of after the if statement.

Test Plan
  • jpaetzel@ confirmed this fixed a panic he was seeing on head. The panic was a WITNESS warning about the lock still being held when an ithread suspended.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb created this revision.Aug 15 2017, 11:33 PM

The path for the file to be patched is wrong, the original is correct in this case. The code change does fix the kernel panic when the module is loaded.

jhb updated this revision to Diff 32103.Aug 16 2017, 1:24 AM
  • Fix file path.
This revision is now accepted and ready to land.Aug 17 2017, 4:48 PM
swills accepted this revision.Aug 17 2017, 5:29 PM

Approved, thanks!

This revision was automatically updated to reflect the committed changes.