Commit c7e5d9f1 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365070


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 9f237eac
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -107,6 +107,12 @@ ut_send_request(fs_request_fn fn, void *arg)
		}
		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