lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <8be68ef8cbbf4778f66c3fb169681355e75b2fff.1444302968.git.sergei@s15v.net>
Date:	Thu,  8 Oct 2015 14:31:46 +0300
From:	Sergei Zviagintsev <sergei@...v.net>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Daniel Mack <daniel@...que.org>,
	David Herrmann <dh.herrmann@...glemail.com>,
	Djalal Harouni <tixxdz@...ndz.org>
Cc:	linux-kernel@...r.kernel.org, Sergei Zviagintsev <sergei@...v.net>
Subject: [PATCH 17/44] kdbus: Drop duplicated code from kdbus_pool_slice_alloc()

Check the value of `ret' instead of keeping separate exit point.

Signed-off-by: Sergei Zviagintsev <sergei@...v.net>
---
 ipc/kdbus/pool.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ipc/kdbus/pool.c b/ipc/kdbus/pool.c
index cb692a35755b..75a7366baa34 100644
--- a/ipc/kdbus/pool.c
+++ b/ipc/kdbus/pool.c
@@ -261,13 +261,10 @@ struct kdbus_pool_slice *kdbus_pool_slice_alloc(struct kdbus_pool *pool,
 	s->accounted = accounted;
 	if (accounted)
 		pool->accounted_size += s->size;
-	mutex_unlock(&pool->lock);
-
-	return s;
 
 exit_unlock:
 	mutex_unlock(&pool->lock);
-	return ERR_PTR(ret);
+	return ret < 0 ? ERR_PTR(ret) : s;
 }
 
 static void __kdbus_pool_slice_release(struct kdbus_pool_slice *slice)
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ