From 3572dea606b952546da35be2d02d5a51edb96fca Mon Sep 17 00:00:00 2001 From: dchagin Date: Sun, 3 Feb 2013 18:37:08 +0000 Subject: [PATCH] MFC r245908: Arithmetic on pointers takes into account the size of the type. Properly cast the pointer to avoid incorrect pointer scaling. git-svn-id: svn://svn.freebsd.org/base/stable/9@246292 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/compat/linux/linux_futex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index c87fd0052..c1531d0f4 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -1203,7 +1203,7 @@ release_futexes(struct proc *p) if (entry != pending) if (handle_futex_death(p, - (uint32_t *)entry + futex_offset, pi)) { + (uint32_t *)((caddr_t)entry + futex_offset), pi)) { LIN_SDT_PROBE0(futex, release_futexes, return); return; } @@ -1222,7 +1222,7 @@ release_futexes(struct proc *p) } if (pending) - handle_futex_death(p, (uint32_t *)pending + futex_offset, pip); + handle_futex_death(p, (uint32_t *)((caddr_t)pending + futex_offset), pip); LIN_SDT_PROBE0(futex, release_futexes, return); } -- 2.45.0