From: Jon Maloy <jon.maloy@ericsson.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <mohan.krishna.ghanta.krishnamurthy@ericsson.com>,
<tung.q.nguyen@dektech.com.au>, <hoang.h.le@dektech.com.au>,
<jon.maloy@ericsson.com>, <canh.d.luu@dektech.com.au>,
<ying.xue@windriver.com>, <tipc-discussion@lists.sourceforge.net>
Subject: [net-next 1/1] tipc: fix bug on error path in tipc_topsrv_kern_subscr()
Date: Mon, 19 Feb 2018 12:48:21 +0100 [thread overview]
Message-ID: <1519040901-21132-1-git-send-email-jon.maloy@ericsson.com> (raw)
In commit cc1ea9ffadf7 ("tipc: eliminate struct tipc_subscriber") we
re-introduced an old bug on the error path in the function
tipc_topsrv_kern_subscr(). We now re-introduce the correction too.
Reported-by: syzbot+f62e0f2a0ef578703946@syzkaller.appspotmail.com
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
net/tipc/topsrv.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c
index 02013e0..25925be 100644
--- a/net/tipc/topsrv.c
+++ b/net/tipc/topsrv.c
@@ -580,9 +580,10 @@ bool tipc_topsrv_kern_subscr(struct net *net, u32 port, u32 type, u32 lower,
*conid = con->conid;
con->sock = NULL;
rc = tipc_conn_rcv_sub(tipc_topsrv(net), con, &sub);
- if (rc < 0)
- tipc_conn_close(con);
- return !rc;
+ if (rc >= 0)
+ return true;
+ conn_put(con);
+ return false;
}
void tipc_topsrv_kern_unsubscr(struct net *net, int conid)
--
2.1.4
next reply other threads:[~2018-02-19 11:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 11:48 Jon Maloy [this message]
2018-02-19 19:39 ` [net-next 1/1] tipc: fix bug on error path in tipc_topsrv_kern_subscr() David Miller
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=1519040901-21132-1-git-send-email-jon.maloy@ericsson.com \
--to=jon.maloy@ericsson.com \
--cc=canh.d.luu@dektech.com.au \
--cc=davem@davemloft.net \
--cc=hoang.h.le@dektech.com.au \
--cc=mohan.krishna.ghanta.krishnamurthy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=tung.q.nguyen@dektech.com.au \
--cc=ying.xue@windriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).