[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8729016553E3654398EA69218DA29EEF15BC901A@cnshjmbx02>
Date: Thu, 15 Jun 2017 09:54:33 +0000
From: YUAN Linyu <Linyu.Yuan@...atel-sbell.com.cn>
To: Johannes Berg <johannes@...solutions.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: Johannes Berg <johannes.berg@...el.com>
Subject: RE: [RFC v2] networking: convert many more places to skb_put_zero()
> -----Original Message-----
> From: netdev-owner@...r.kernel.org [mailto:netdev-owner@...r.kernel.org]
> On Behalf Of Johannes Berg
> Sent: Thursday, June 15, 2017 5:28 PM
> To: netdev@...r.kernel.org
> Cc: Johannes Berg
> Subject: [RFC v2] networking: convert many more places to skb_put_zero()
>
> From: Johannes Berg <johannes.berg@...el.com>
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index ea2601501654..aaac2660aaf7 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -1478,10 +1478,9 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk,
> int len, const void *data)
> int chunklen = ntohs(chunk->chunk_hdr->length);
> int padlen = SCTP_PAD4(chunklen) - chunklen;
>
> - padding = skb_put(chunk->skb, padlen);
> + padding = skb_put_zero(chunk->skb, padlen);
"padding" will become unused.
I know this place when I check.
> target = skb_put(chunk->skb, len);
>
> - memset(padding, 0, padlen);
> memcpy(target, data, len);
>
> /* Adjust the chunk length field. */
> --
> 2.11.0
Powered by blists - more mailing lists