test/blobfs_sync: prevent local variable address escape
Make sure the global request pointer is not pointing at the local req variable when we exit the function. Change-Id: If0df4fdc3ca013e324b65b81f3f11ba3ff34f108 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/365070 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
9f237eac85
commit
c7e5d9f1b7
@ -107,6 +107,12 @@ ut_send_request(fs_request_fn fn, void *arg)
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&g_mutex);
|
pthread_mutex_unlock(&g_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make sure the address of the local req variable is not in g_req when we exit this
|
||||||
|
* function to make static analysis tools happy.
|
||||||
|
*/
|
||||||
|
g_req = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user