Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kenv: Fix preload_delete_name() in purecap kernels #2324

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions sys/kern/subr_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@
void
preload_delete_name(const char *name)
{
caddr_t addr, curp;
caddr_t curp;
vm_offset_t addr;
uint32_t *hdr, sz;
int next;
int clearing;
Expand All @@ -226,7 +227,7 @@
if (hdr[0] == MODINFO_NAME || (hdr[0] == 0 && hdr[1] == 0)) {
/* Free memory used to store the file. */
if (addr != 0 && sz != 0)
kmem_bootstrap_free((vm_offset_t)addr, sz);
kmem_bootstrap_free(addr, sz);
addr = 0;
sz = 0;

Expand All @@ -240,10 +241,10 @@
}
if (clearing) {
if (hdr[0] == MODINFO_ADDR)
addr = *(caddr_t *)(curp + sizeof(uint32_t) * 2);
addr = *(vm_offset_t *)(curp + sizeof(uint32_t) * 2);
else if (hdr[0] == MODINFO_SIZE)
sz = *(uint32_t *)(curp + sizeof(uint32_t) * 2);
hdr[0] = MODINFO_EMPTY;

Check warning on line 247 in sys/kern/subr_module.c

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
}

/* skip to next field */
Expand Down