[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b1c6862-ad2f-f639-42e3-b793aefbfd78@tessares.net>
Date: Mon, 9 Nov 2020 17:35:02 +0100
From: Matthieu Baerts <matthieu.baerts@...sares.net>
To: Geliang Tang <geliangtang@...il.com>,
Mat Martineau <mathew.j.martineau@...ux.intel.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, mptcp@...ts.01.org,
linux-kernel@...r.kernel.org,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [MPTCP][PATCH net 2/2] mptcp: cleanup for
mptcp_pm_alloc_anno_list
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@...il.com>
> Reviewed-by: Dan Carpenter <dan.carpenter@...cle.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
Powered by blists - more mailing lists