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: <8cc42b4b6f50de0ce700d4c3b18e732617469a1d.1444302968.git.sergei@s15v.net>
Date:	Thu,  8 Oct 2015 14:31:52 +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 23/44] kdbus: Cleanup kdbus_conn_call()

Do not initialize `wait' and `name' as values are assigned to them at
first use: `wait' gets its value from kdbus_reply_find(), `name' is set
by kdbus_pin_dst().

Remove redundant code. goto isn't required as we reached exit point
already. Setting `ret' to zero is unnecessary because
kdbus_conn_entry_insert() returns 0 on success.

Signed-off-by: Sergei Zviagintsev <sergei@...v.net>
---
 ipc/kdbus/connection.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index a4d7414ecaea..db49f282a1bf 100644
--- a/ipc/kdbus/connection.c
+++ b/ipc/kdbus/connection.c
@@ -1159,8 +1159,8 @@ static struct kdbus_reply *kdbus_conn_call(struct kdbus_conn *src,
 					   ktime_t exp)
 {
 	const struct kdbus_msg *msg = staging->msg;
-	struct kdbus_name_entry *name = NULL;
-	struct kdbus_reply *wait = NULL;
+	struct kdbus_name_entry *name;
+	struct kdbus_reply *wait;
 	struct kdbus_conn *dst = NULL;
 	struct kdbus_bus *bus = src->ep->bus;
 	int ret;
@@ -1212,14 +1212,8 @@ static struct kdbus_reply *kdbus_conn_call(struct kdbus_conn *src,
 	}
 
 	/* send message */
-
 	kdbus_bus_eavesdrop(bus, src, staging);
-
 	ret = kdbus_conn_entry_insert(src, dst, staging, wait, name);
-	if (ret < 0)
-		goto exit;
-
-	ret = 0;
 
 exit:
 	up_read(&bus->name_registry->rwlock);
-- 
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