]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: tipc: prevent possible null deref of link
authorCengiz Can <cengiz@kernel.wtf>
Mon, 7 Dec 2020 08:14:24 +0000 (11:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2020 12:28:18 +0000 (13:28 +0100)
commit4dd9051068f536453e7e8fedc7c6cc873a0910d7
tree17625e98118ca81945ecf18cd582f07383f32832
parent2ab0a44384cbaa26b5bc6469e27c36afbd860c55
net: tipc: prevent possible null deref of link

[ Upstream commit 0398ba9e5a4b5675aa571e0445689d3c2e499c2d ]

`tipc_node_apply_property` does a null check on a `tipc_link_entry`
pointer but also accesses the same pointer out of the null check block.

This triggers a warning on Coverity Static Analyzer because we're
implying that `e->link` can BE null.

Move "Update MTU for node link entry" line into if block to make sure
that we're not in a state that `e->link` is null.

Signed-off-by: Cengiz Can <cengiz@kernel.wtf>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/node.c