mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-23 00:50:36 +02:00
util/futex: fix dangling pointer use
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110901
Fixes: 7dc2f47882 "util: emulate futex on FreeBSD using umtx"
Cc: Greg V <greg@unrelenting.technology>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
parent
d378151246
commit
9996ddbb27
1 changed files with 5 additions and 5 deletions
|
|
@ -69,15 +69,15 @@ static inline int futex_wake(uint32_t *addr, int count)
|
|||
static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *timeout)
|
||||
{
|
||||
void *uaddr = NULL, *uaddr2 = NULL;
|
||||
struct _umtx_time tmo = {
|
||||
._flags = UMTX_ABSTIME,
|
||||
._clockid = CLOCK_MONOTONIC
|
||||
};
|
||||
|
||||
assert(value == (int)(uint32_t)value); /* Check that bits weren't discarded */
|
||||
|
||||
if (timeout != NULL) {
|
||||
const struct _umtx_time tmo = {
|
||||
._timeout = *timeout,
|
||||
._flags = UMTX_ABSTIME,
|
||||
._clockid = CLOCK_MONOTONIC
|
||||
};
|
||||
tmo._timeout = *timeout;
|
||||
uaddr = (void *)(uintptr_t)sizeof(tmo);
|
||||
uaddr2 = (void *)&tmo;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue