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

nvme: sync up unit test nvme_impl.h mutex wrapper



The default version of nvme_impl.h was cleaned up to release the pthread
mutex attr on failure cases, but the unit test version did not receive
this update.

Change-Id: I899b7dc809393dc8e6fd24ed98e1d0a61ecf1c95
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 2bec4400
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -101,14 +101,17 @@ static inline int
nvme_mutex_init_recursive(nvme_mutex_t *mtx)
{
	pthread_mutexattr_t attr;
	int rc = 0;

	if (pthread_mutexattr_init(&attr)) {
		return -1;
	}
	if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE)) {
		return -1;
	if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) ||
	    pthread_mutex_init(mtx, &attr)) {
		rc = -1;
	}
	return pthread_mutex_init(mtx, &attr);
	pthread_mutexattr_destroy(&attr);
	return rc;
}

/**