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
F97165428: D42965.diff
Sat, Sep 28, 12:27 AM
Unknown Object (File)
Fri, Sep 20, 4:43 PM
Unknown Object (File)
Mon, Sep 16, 5:47 AM
Unknown Object (File)
Wed, Sep 11, 8:41 AM
Unknown Object (File)
Thu, Sep 5, 10:28 PM
Unknown Object (File)
Aug 17 2024, 9:36 AM
Unknown Object (File)
Aug 4 2024, 1:23 AM
Unknown Object (File)
Aug 4 2024, 1:23 AM
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