Skip to content

Commit

Permalink
netlink: remove duplicated nla_need_padding_for_64bit() check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miaohe Lin authored and David S. Miller committed Aug 25, 2020
1 parent 8b4510d commit 4718a47
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/nlattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4718a47

Please sign in to comment.