All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH 1/3] mptcp: fix mistake in path manager interface
@ 2019-10-21 23:41 Peter Krystad
  0 siblings, 0 replies; only message in thread
From: Peter Krystad @ 2019-10-21 23:41 UTC (permalink / raw)
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

Do not de-reference NULL pointer immediately after confirming it
is NULL.

squashto:  Implement path manager interface commands

Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index f521bf0c5f69..d45406bc3f6c 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -95,7 +95,7 @@ int mptcp_pm_create_subflow(u32 token, u8 remote_id, struct in_addr *addr)
 
 	local.sin_family = AF_INET;
 	local.sin_port = 0;
-	if (!addr)
+	if (addr)
 		local.sin_addr = *addr;
 	else
 		local.sin_addr.s_addr = htonl(INADDR_ANY);
@@ -133,7 +133,7 @@ int mptcp_pm_create_subflow6(u32 token, u8 remote_id, struct in6_addr *addr)
 
 	local.sin6_family = AF_INET6;
 	local.sin6_port = 0;
-	if (!addr)
+	if (addr)
 		local.sin6_addr = *addr;
 	else
 		local.sin6_addr = in6addr_any;
-- 
2.17.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-21 23:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-21 23:41 [MPTCP] [PATCH 1/3] mptcp: fix mistake in path manager interface Peter Krystad

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.