summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2013-01-25 14:40:54 +0000
committerdchagin <dchagin@FreeBSD.org>2013-01-25 14:40:54 +0000
commitfa34eceef79e479ff9977bba93253e5940d8def0 (patch)
tree0b16b6b3f232c76cc6076aca41bdf8fa7219b575 /sys/compat
parentff11706b2fb848c833874a27d918f24b88505bfb (diff)
downloadFreeBSD-src-fa34eceef79e479ff9977bba93253e5940d8def0.zip
FreeBSD-src-fa34eceef79e479ff9977bba93253e5940d8def0.tar.gz
Arithmetic on pointers takes into account the size of the type. Properly cast the pointer to avoid incorrect pointer scaling.
MFC after: 1 Week
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_futex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c
index c87fd00..c1531d0 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);
}
OpenPOWER on IntegriCloud