lkml.org 
[lkml]   [2020]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [MPTCP][PATCH net 1/2] mptcp: fix static checker warnings in mptcp_pm_add_timer
Date
Hi Geliang, Dan,

On 09/11/2020 14:59, Geliang Tang wrote:
> Fix the following Smatch complaint:

Thanks for the report and the patch!

> 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>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

A small detail (I think): the Signed-off-by of the sender (Geliang)
should be the last one in the list if I am not mistaken.
But I guess this is not blocking.

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>

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

\
 
 \ /
  Last update: 2020-11-09 17:30    [W:0.798 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site