Page MenuHomeFreeBSD

kldxref: Refactor PNP entry parsing, no functional change
ClosedPublic

Authored by jhb on Dec 7 2023, 7:57 PM.
Tags
None
Referenced Files
F87297815: D42965.diff
Mon, Jul 1, 10:57 AM
Unknown Object (File)
Sat, Jun 29, 4:09 AM
Unknown Object (File)
Sat, Jun 29, 3:57 AM
Unknown Object (File)
Fri, Jun 28, 3:26 AM
Unknown Object (File)
Wed, Jun 26, 12:28 AM
Unknown Object (File)
Tue, Jun 25, 12:15 PM
Unknown Object (File)
Fri, Jun 21, 12:28 AM
Unknown Object (File)
Thu, Jun 20, 11:36 PM
Subscribers
None

Details

Summary
  • Add a free_pnp_list to complement parse_pnp_list. Add freeing of 'new_desc' which was previously leaked.
  • Move body of loop that checked a single pnp list element against a table entry into a parse_pnp_entry function to reduce indentation and split parse_entry into a smaller function.
  • Similarly, split out a record_pnp_info function from parse_entry which builds the pnp_list and walks a table.

Sponsored by: DARPA

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Dec 7 2023, 7:57 PM
jhb created this revision.
jhb added a parent revision: D42964: Stop #defining FREEBSD_ELF.
usr.sbin/kldxref/kldxref.c
495

Leaks new_descr?

usr.sbin/kldxref/kldxref.c
495

Yes, in fact it should just call free_pnp_list().

Seems good to me now.

This revision is now accepted and ready to land.Dec 11 2023, 2:53 AM