All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Stanislav Fomichev <sdf.kernel@gmail.com>
Cc: Chas Williams <3chas3@gmail.com>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 Magnus Karlsson <magnus.karlsson@intel.com>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	 Stanislav Fomichev <sdf@fomichev.me>,
	Alexei Starovoitov <ast@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	 John Fastabend <john.fastabend@gmail.com>,
	Jon Maloy <jmaloy@redhat.com>,
	 Alexandra Winter <wintera@linux.ibm.com>,
	Thorsten Winkler <twinkler@linux.ibm.com>,
	 James Chapman <jchapman@katalix.com>,
	David Howells <dhowells@redhat.com>,
	 Marc Dionne <marc.dionne@auristor.com>,
	David Heidelberg <david+nfc@ixit.cz>,
	 Samuel Ortiz <sameo@linux.intel.com>,
	linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	tipc-discussion@lists.sourceforge.net,
	 linux-s390@vger.kernel.org, linux-afs@lists.infradead.org,
	oe-linux-nfc@lists.linux.dev,  kernel-team@meta.com
Subject: Re: [PATCH net-next 4/6] l2tp: ppp: convert to getsockopt_iter
Date: Fri, 15 May 2026 01:15:10 -0700	[thread overview]
Message-ID: <agbVsd9bzIhylAwH@gmail.com> (raw)
In-Reply-To: <agSZeMEvxE0xyNB8@devvm7509.cco0.facebook.com>

On Wed, May 13, 2026 at 08:32:39AM -0700, Stanislav Fomichev wrote:
> > @@ -1358,12 +1357,11 @@ static int pppol2tp_getsockopt(struct socket *sock, int level, int optname,
> >  			goto end_put_sess;
> >  	}
> >  
> > -	err = -EFAULT;
> > -	if (put_user(len, optlen))
> > -		goto end_put_sess;
> > -
> > -	if (copy_to_user((void __user *)optval, &val, len))
> > +	opt->optlen = len;
> > +	if (copy_to_iter(&val, len, &opt->iter_out) != len) {
> > +		err = -EFAULT;
> >  		goto end_put_sess;
> > +	}
> >  
> >  	err = 0;
> 
> nit: if you're moving `err = -EFAULT`, you might as well remove this
> `err = 0` ?

Good point, if we got here, err is already = 0, and this line becomes
useless.

Also, we probably don't need the "goto end_put_sess;" above, given the
next line is the "end_put_sess" label.

Thanks for the review, I will update.
--breno

  reply	other threads:[~2026-05-15  8:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 12:34 [PATCH net-next 0/6] net: convert atm/xdp/af_iucv/l2tp_ppp/rxrpc/tipc to getsockopt_iter Breno Leitao
2026-05-13 12:34 ` [PATCH net-next 1/6] atm: convert " Breno Leitao
2026-05-13 15:29   ` Stanislav Fomichev
2026-05-14 12:45   ` sashiko-bot
2026-05-14 14:52     ` Breno Leitao
2026-05-13 12:34 ` [PATCH net-next 2/6] xdp: " Breno Leitao
2026-05-13 15:30   ` Stanislav Fomichev
2026-05-13 12:34 ` [PATCH net-next 3/6] af_iucv: " Breno Leitao
2026-05-13 15:30   ` Stanislav Fomichev
2026-05-14 12:45   ` sashiko-bot
2026-05-14 16:52     ` Breno Leitao
2026-05-13 12:34 ` [PATCH net-next 4/6] l2tp: ppp: " Breno Leitao
2026-05-13 15:32   ` Stanislav Fomichev
2026-05-15  8:15     ` Breno Leitao [this message]
2026-05-13 12:34 ` [PATCH net-next 5/6] rxrpc: " Breno Leitao
2026-05-13 15:33   ` Stanislav Fomichev
2026-05-13 12:34 ` [PATCH net-next 6/6] tipc: " Breno Leitao
2026-05-13 15:34   ` Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agbVsd9bzIhylAwH@gmail.com \
    --to=leitao@debian.org \
    --cc=3chas3@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=david+nfc@ixit.cz \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=jchapman@katalix.com \
    --cc=jmaloy@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-linux-nfc@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=sameo@linux.intel.com \
    --cc=sdf.kernel@gmail.com \
    --cc=sdf@fomichev.me \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=twinkler@linux.ibm.com \
    --cc=wintera@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.