Subject: Re: [RFC v2] networking: convert many more places to skb_put_zero()

From: Johannes Berg <[email-masked]>
Date: Thu, 15 Jun 2017 13:58:07 +0200

On Thu, 2017-06-15 at 09:54 +0000, YUAN Linyu wrote:
> > -----Original Message-----
> > From: [email-masked] [mailto:[email-masked]
> > .org]
> > On Behalf Of Johannes Berg
> > Sent: Thursday, June 15, 2017 5:28 PM
> > To: [email-masked]
> > Cc: Johannes Berg
> > Subject: [RFC v2] networking: convert many more places to
> > skb_put_zero()
> > 
> > From: Johannes Berg <[email-masked]>
> > 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.

Yeah, I figured that would happen. I could try to make the spatch catch
that too, but I'm not sure I can figure out how to :)

johannes