summaryrefslogtreecommitdiffstats
path: root/kdbus-kdbus_item_validate-remove-duplicated-code.patch
blob: f00aa6ecaae7f488614630c706abaf9bcbfe85bd (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
From: Sergei Zviagintsev <sergei@s15v.net>
Date: Tue, 2 Jun 2015 18:48:49 +0300
Subject: [PATCH] kdbus: kdbus_item_validate(): remove duplicated code

KDBUS_ITEM_PAYLOAD_VEC and KDBUS_ITEM_PAYLOAD_OFF cases use literally
the same code, so merge them.

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/item.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/ipc/kdbus/item.c b/ipc/kdbus/item.c
index 745ad5495096..1ee72c2ad7c3 100644
--- a/ipc/kdbus/item.c
+++ b/ipc/kdbus/item.c
@@ -96,12 +96,6 @@ int kdbus_item_validate(const struct kdbus_item *item)
 		break;
 
 	case KDBUS_ITEM_PAYLOAD_VEC:
-		if (payload_size != sizeof(struct kdbus_vec))
-			return -EINVAL;
-		if (item->vec.size == 0 || item->vec.size > SIZE_MAX)
-			return -EINVAL;
-		break;
-
 	case KDBUS_ITEM_PAYLOAD_OFF:
 		if (payload_size != sizeof(struct kdbus_vec))
 			return -EINVAL;