git: e499988f0cc4 - main - exec_elf: use intermediate u_long variable to correct mismatched type

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 12 Dec 2021 18:07:10 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=e499988f0cc45ad2e21573b6d11c9cefdd37608d

commit e499988f0cc45ad2e21573b6d11c9cefdd37608d
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-12-12 16:47:26 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-12-12 18:07:04 +0000

    exec_elf: use intermediate u_long variable to correct mismatched type
    
    vm_offset_t * vs. u_long *
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/kern/imgact_elf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index b926bc926611..ce04e845cef5 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -1112,7 +1112,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
 	Elf_Brandinfo *brand_info;
 	struct sysentvec *sv;
 	u_long addr, baddr, et_dyn_addr, entry, proghdr;
-	u_long maxalign, maxsalign, mapsz, maxv, maxv1;
+	u_long maxalign, maxsalign, mapsz, maxv, maxv1, anon_loc;
 	uint32_t fctl0;
 	int32_t osrel;
 	bool free_interp;
@@ -1356,9 +1356,10 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
 		maxv1 = maxv / 2 + addr / 2;
 		error = __CONCAT(rnd_, __elfN(base))(map, addr, maxv1,
 		    (MAXPAGESIZES > 1 && pagesizes[1] != 0) ?
-		    pagesizes[1] : pagesizes[0], &map->anon_loc);
+		    pagesizes[1] : pagesizes[0], &anon_loc);
 		if (error != 0)
 			goto ret;
+		map->anon_loc = anon_loc;
 	} else {
 		map->anon_loc = addr;
 	}