Page MenuHomeFreeBSD

Rework the logic of register_mem_int(). (Based on CID 1194192: Resource leak)
AbandonedPublic

Authored by araujo on May 24 2018, 3:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 19 2024, 9:20 PM
Unknown Object (File)
Dec 25 2023, 12:54 AM
Unknown Object (File)
Jul 27 2023, 10:25 AM
Unknown Object (File)
Jun 20 2023, 9:42 PM
Unknown Object (File)
Jun 5 2023, 9:03 PM
Unknown Object (File)
Jun 3 2023, 1:48 AM
Unknown Object (File)
May 14 2023, 6:26 AM
Unknown Object (File)
Feb 11 2023, 1:03 AM
Subscribers

Details

Summary

While I was investigating CID 1194192 related with a resource leak on mrp memory allocation, I could identify that actually we use this pointer on pci_emul.c as well as on vga.c source file. We use assert(3) on those files to make sure that the return value is 0.

I have reworked the logic here to make it more readable and also add a warn to explicit show the function where the memory allocation error could happen, also sort headers.

Also I will mark CID 1194192 as "Intentional".

Test Plan

Rebuild bhyve with this patch:

  1. Test FreeBSD HEAD guest.
  2. Test FreeBSD HEAD guest with wired memory (-S).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16800
Build 16685: arc lint + arc unit

Event Timeline

araujo added reviewers: grehan, neel, tychon, anish, jhb.
usr.sbin/bhyve/mem.c
40

sys/types.h is always first (it's in style(9))

Address @jhb issue regards with the respect of style(9).

araujo added inline comments.
usr.sbin/bhyve/mem.c
40

Thank you!

araujo marked an inline comment as done.

Committed at r335050!

Thanks..