From: Jakub Kicinski <kuba at kernel.org>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [MPTCP][PATCH v2 net-next] mptcp: fix static checker warnings in mptcp_pm_add_timer
Date: Thu, 12 Nov 2020 07:55:54 -0800 [thread overview]
Message-ID: <20201112075554.00739ede@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: 078a2ef5bdc4e3b2c25ef852461692001f426495.1604976945.git.geliangtang@gmail.com
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
On Tue, 10 Nov 2020 11:01:43 +0800 Geliang Tang wrote:
> Fix the following Smatch complaint:
>
> net/mptcp/pm_netlink.c:213 mptcp_pm_add_timer()
> warn: variable dereferenced before check 'msk' (see line 208)
>
> net/mptcp/pm_netlink.c
> 207 struct mptcp_sock *msk = entry->sock;
> 208 struct sock *sk = (struct sock *)msk;
> 209 struct net *net = sock_net(sk);
> ^^
> "msk" dereferenced here.
>
> 210
> 211 pr_debug("msk=%p", msk);
> 212
> 213 if (!msk)
> ^^^^
> Too late.
>
> 214 return;
> 215
>
> Fixes: 93f323b9cccc ("mptcp: add a new sysctl add_addr_timeout")
> Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
> Reviewed-by: Dan Carpenter <dan.carpenter(a)oracle.com>
> Reviewed-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
> Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
Applied, thanks!
WARNING: multiple messages have this Message-ID (diff)
From: Jakub Kicinski <kuba@kernel.org>
To: Geliang Tang <geliangtang@gmail.com>
Cc: Mat Martineau <mathew.j.martineau@linux.intel.com>,
Matthieu Baerts <matthieu.baerts@tessares.net>,
"David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, mptcp@lists.01.org,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [MPTCP][PATCH v2 net-next] mptcp: fix static checker warnings in mptcp_pm_add_timer
Date: Thu, 12 Nov 2020 07:55:54 -0800 [thread overview]
Message-ID: <20201112075554.00739ede@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <078a2ef5bdc4e3b2c25ef852461692001f426495.1604976945.git.geliangtang@gmail.com>
On Tue, 10 Nov 2020 11:01:43 +0800 Geliang Tang wrote:
> Fix the following Smatch complaint:
>
> net/mptcp/pm_netlink.c:213 mptcp_pm_add_timer()
> warn: variable dereferenced before check 'msk' (see line 208)
>
> net/mptcp/pm_netlink.c
> 207 struct mptcp_sock *msk = entry->sock;
> 208 struct sock *sk = (struct sock *)msk;
> 209 struct net *net = sock_net(sk);
> ^^
> "msk" dereferenced here.
>
> 210
> 211 pr_debug("msk=%p", msk);
> 212
> 213 if (!msk)
> ^^^^
> Too late.
>
> 214 return;
> 215
>
> Fixes: 93f323b9cccc ("mptcp: add a new sysctl add_addr_timeout")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Applied, thanks!
next reply other threads:[~2020-11-12 15:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 15:55 Jakub Kicinski [this message]
2020-11-12 15:55 ` [MPTCP][PATCH v2 net-next] mptcp: fix static checker warnings in mptcp_pm_add_timer Jakub Kicinski
-- strict thread matches above, loose matches on Subject: below --
2020-11-10 3:01 [MPTCP] " Geliang Tang
2020-11-10 3:01 ` 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=20201112075554.00739ede@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=unknown@example.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.