summaryrefslogtreecommitdiffstats
path: root/kdbus-remove-redundant-code-from-kdbus_conn_entry_ma.patch
blob: c31ad064416df1780af54ec60397c57e3ce237a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Sergei Zviagintsev <sergei@s15v.net>
Date: Tue, 2 Jun 2015 18:48:48 +0300
Subject: [PATCH] kdbus: remove redundant code from kdbus_conn_entry_make()

We don't need to check `entry' for error, as in either case it is
returned as is. Return result of kdbus_queue_entry_new() directly.

Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 ipc/kdbus/connection.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index 8ee62fc0bd46..1bd7bb968f9f 100644
--- a/ipc/kdbus/connection.c
+++ b/ipc/kdbus/connection.c
@@ -775,8 +775,6 @@ kdbus_conn_entry_make(struct kdbus_conn *conn_dst,
 		      const struct kdbus_kmsg *kmsg,
 		      struct kdbus_user *user)
 {
-	struct kdbus_queue_entry *entry;
-
 	/* The remote connection was disconnected */
 	if (!kdbus_conn_active(conn_dst))
 		return ERR_PTR(-ECONNRESET);
@@ -793,11 +791,7 @@ kdbus_conn_entry_make(struct kdbus_conn *conn_dst,
 	    kmsg->res && kmsg->res->fds_count > 0)
 		return ERR_PTR(-ECOMM);
 
-	entry = kdbus_queue_entry_new(conn_dst, kmsg, user);
-	if (IS_ERR(entry))
-		return entry;
-
-	return entry;
+	return kdbus_queue_entry_new(conn_dst, kmsg, user);
 }
 
 /*