netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Baerts <matthieu.baerts@tessares.net>
To: Geliang Tang <geliangtang@gmail.com>,
	Mat Martineau <mathew.j.martineau@linux.intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, mptcp@lists.01.org,
	linux-kernel@vger.kernel.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [MPTCP][PATCH net 2/2] mptcp: cleanup for mptcp_pm_alloc_anno_list
Date: Mon, 9 Nov 2020 17:35:02 +0100	[thread overview]
Message-ID: <8b1c6862-ad2f-f639-42e3-b793aefbfd78@tessares.net> (raw)
In-Reply-To: <0f17d2f60c188554d093e820c45caf20fe53aab0.1604930005.git.geliangtang@gmail.com>

Hi Geliang,

On 09/11/2020 14:59, Geliang Tang wrote:
> This patch added NULL pointer check for mptcp_pm_alloc_anno_list, and
> avoided similar static checker warnings in mptcp_pm_add_timer.
> 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

I think Dan reviewed the v1 of your patch -- without some modifications 
below -- but not the v2 nor this one.

> ---
>   net/mptcp/pm_netlink.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 03f2c28f11f5..dfc1bed4a55f 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -266,7 +266,9 @@ static bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
>   {
>   	struct mptcp_pm_add_entry *add_entry = NULL;
>   	struct sock *sk = (struct sock *)msk;
> -	struct net *net = sock_net(sk);
> +
> +	if (!msk)
> +		return false;

As Dan mentioned on MPTCP ML, this check is not required: "msk" cannot 
be NULL here.

We can maybe keep the cleanup (only move sock_net() below) but I don't 
think we need or want this in -net.
I am not even sure we want it in net-next but why not :)
This could also be part of other refactors.

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

  reply	other threads:[~2020-11-09 16:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 13:59 [MPTCP][PATCH net 0/2] fix static checker warnings in Geliang Tang
2020-11-09 13:59 ` [MPTCP][PATCH net 1/2] mptcp: fix static checker warnings in mptcp_pm_add_timer Geliang Tang
2020-11-09 13:59   ` [MPTCP][PATCH net 2/2] mptcp: cleanup for mptcp_pm_alloc_anno_list Geliang Tang
2020-11-09 16:35     ` Matthieu Baerts [this message]
2020-11-09 16:28   ` [MPTCP][PATCH net 1/2] mptcp: fix static checker warnings in mptcp_pm_add_timer Matthieu Baerts
2020-11-09 18:34     ` Dan Carpenter
2020-11-09 20:56       ` Jakub Kicinski
2020-11-09 20:57     ` Jakub Kicinski
2020-11-09 21:23       ` Matthieu Baerts
2020-11-09 22:20         ` Jakub Kicinski
2020-11-12  2:36           ` Geliang Tang

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=8b1c6862-ad2f-f639-42e3-b793aefbfd78@tessares.net \
    --to=matthieu.baerts@tessares.net \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=geliangtang@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=mptcp@lists.01.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).