netlink: remove duplicated nla_need_padding_for_64bit() check
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 25 Aug 2020 03:25:17 +0000 (23:25 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Aug 2020 13:06:19 +0000 (06:06 -0700)
The need for padding 64bit is implicitly checked by nla_align_64bit(), so
remove this explicit one.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/nlattr.c

index 665bdaff02c821c422c023d7525e147fceeb96fd..80ff9fe83696f881a5b5cda30c2afe13cd33b25a 100644 (file)
@@ -834,8 +834,7 @@ EXPORT_SYMBOL(__nla_reserve);
 struct nlattr *__nla_reserve_64bit(struct sk_buff *skb, int attrtype,
                                   int attrlen, int padattr)
 {
-       if (nla_need_padding_for_64bit(skb))
-               nla_align_64bit(skb, padattr);
+       nla_align_64bit(skb, padattr);
 
        return __nla_reserve(skb, attrtype, attrlen);
 }