KDBUS_ITEM_PAYLOAD_VEC and KDBUS_ITEM_PAYLOAD_OFF cases use literally
the same code, so merge them.
Signed-off-by: Sergei Zviagintsev <[email protected]>
---
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;
--
1.8.3.1
Hi
On Tue, Jun 2, 2015 at 5:48 PM, Sergei Zviagintsev <[email protected]> wrote:
> KDBUS_ITEM_PAYLOAD_VEC and KDBUS_ITEM_PAYLOAD_OFF cases use literally
> the same code, so merge them.
>
> Signed-off-by: Sergei Zviagintsev <[email protected]>
> ---
> ipc/kdbus/item.c | 6 ------
> 1 file changed, 6 deletions(-)
Reviewed-by: David Herrmann <[email protected]>
Thanks
David
> 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;
> --
> 1.8.3.1
>