aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/attr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/netlink/attr.c b/net/netlink/attr.c
index e4d7bed99c2e..ec39d12c2423 100644
--- a/net/netlink/attr.c
+++ b/net/netlink/attr.c
@@ -27,12 +27,12 @@ static int validate_nla(struct nlattr *nla, int maxtype,
27 const struct nla_policy *policy) 27 const struct nla_policy *policy)
28{ 28{
29 const struct nla_policy *pt; 29 const struct nla_policy *pt;
30 int minlen = 0, attrlen = nla_len(nla); 30 int minlen = 0, attrlen = nla_len(nla), type = nla_type(nla);
31 31
32 if (nla->nla_type <= 0 || nla->nla_type > maxtype) 32 if (type <= 0 || type > maxtype)
33 return 0; 33 return 0;
34 34
35 pt = &policy[nla->nla_type]; 35 pt = &policy[type];
36 36
37 BUG_ON(pt->type > NLA_TYPE_MAX); 37 BUG_ON(pt->type > NLA_TYPE_MAX);
38 38
@@ -149,7 +149,7 @@ int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len,
149 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); 149 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
150 150
151 nla_for_each_attr(nla, head, len, rem) { 151 nla_for_each_attr(nla, head, len, rem) {
152 u16 type = nla->nla_type; 152 u16 type = nla_type(nla);
153 153
154 if (type > 0 && type <= maxtype) { 154 if (type > 0 && type <= maxtype) {
155 if (policy) { 155 if (policy) {
@@ -185,7 +185,7 @@ struct nlattr *nla_find(struct nlattr *head, int len, int attrtype)
185 int rem; 185 int rem;
186 186
187 nla_for_each_attr(nla, head, len, rem) 187 nla_for_each_attr(nla, head, len, rem)
188 if (nla->nla_type == attrtype) 188 if (nla_type(nla) == attrtype)
189 return nla; 189 return nla;
190 190
191 return NULL; 191 return NULL;