From aa9f979c41043d9fcf7957c99948e20bbddefc7f Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 13 Jun 2017 14:28:18 +0200 Subject: networking: use skb_put_zero() Use the recently introduced helper to replace the pattern of skb_put() && memset(), this transformation was done with the following spatch: @@ identifier p; expression len; expression skb; @@ -p = skb_put(skb, len); -memset(p, 0, len); +p = skb_put_zero(skb, len); Signed-off-by: Johannes Berg Signed-off-by: David S. Miller --- lib/nlattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/nlattr.c') diff --git a/lib/nlattr.c b/lib/nlattr.c index a7e0b16078df..d09d9746fc5d 100644 --- a/lib/nlattr.c +++ b/lib/nlattr.c @@ -400,8 +400,7 @@ void *__nla_reserve_nohdr(struct sk_buff *skb, int attrlen) { void *start; - start = skb_put(skb, NLA_ALIGN(attrlen)); - memset(start, 0, NLA_ALIGN(attrlen)); + start = skb_put_zero(skb, NLA_ALIGN(attrlen)); return start; } -- cgit v1.2.3