Commit 8bc81c57 authored by Xin Long's avatar Xin Long Committed by David S. Miller

tipc: remove the unnecessary msg->req check from tipc_nl_compat_bearer_set

tipc_nl_compat_bearer_set() is only called by tipc_nl_compat_link_set()
which already does the check for msg->req check, so remove it from
tipc_nl_compat_bearer_set(), and do the same in tipc_nl_compat_media_set().
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18f3896d
...@@ -683,7 +683,6 @@ static int tipc_nl_compat_media_set(struct sk_buff *skb, ...@@ -683,7 +683,6 @@ static int tipc_nl_compat_media_set(struct sk_buff *skb,
struct nlattr *prop; struct nlattr *prop;
struct nlattr *media; struct nlattr *media;
struct tipc_link_config *lc; struct tipc_link_config *lc;
int len;
lc = (struct tipc_link_config *)TLV_DATA(msg->req); lc = (struct tipc_link_config *)TLV_DATA(msg->req);
...@@ -691,10 +690,6 @@ static int tipc_nl_compat_media_set(struct sk_buff *skb, ...@@ -691,10 +690,6 @@ static int tipc_nl_compat_media_set(struct sk_buff *skb,
if (!media) if (!media)
return -EMSGSIZE; return -EMSGSIZE;
len = min_t(int, TLV_GET_DATA_LEN(msg->req), TIPC_MAX_MEDIA_NAME);
if (!string_is_valid(lc->name, len))
return -EINVAL;
if (nla_put_string(skb, TIPC_NLA_MEDIA_NAME, lc->name)) if (nla_put_string(skb, TIPC_NLA_MEDIA_NAME, lc->name))
return -EMSGSIZE; return -EMSGSIZE;
...@@ -715,7 +710,6 @@ static int tipc_nl_compat_bearer_set(struct sk_buff *skb, ...@@ -715,7 +710,6 @@ static int tipc_nl_compat_bearer_set(struct sk_buff *skb,
struct nlattr *prop; struct nlattr *prop;
struct nlattr *bearer; struct nlattr *bearer;
struct tipc_link_config *lc; struct tipc_link_config *lc;
int len;
lc = (struct tipc_link_config *)TLV_DATA(msg->req); lc = (struct tipc_link_config *)TLV_DATA(msg->req);
...@@ -723,10 +717,6 @@ static int tipc_nl_compat_bearer_set(struct sk_buff *skb, ...@@ -723,10 +717,6 @@ static int tipc_nl_compat_bearer_set(struct sk_buff *skb,
if (!bearer) if (!bearer)
return -EMSGSIZE; return -EMSGSIZE;
len = min_t(int, TLV_GET_DATA_LEN(msg->req), TIPC_MAX_MEDIA_NAME);
if (!string_is_valid(lc->name, len))
return -EINVAL;
if (nla_put_string(skb, TIPC_NLA_BEARER_NAME, lc->name)) if (nla_put_string(skb, TIPC_NLA_BEARER_NAME, lc->name))
return -EMSGSIZE; return -EMSGSIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment