path: root/net
diff options
authorParthasarathy Bhuvaragan <>2016-03-03 17:54:54 +0100
committerDavid S. Miller <>2016-03-06 23:00:08 -0500
commit4de13d7ed6ffdcbb34317acaa9236f121176f5f8 (patch)
treef4a7b6dbc9a3779e18e02ed0534222804b31007b /net
parent11f7f79b40ebfbac6a1bcdbc61d5d13d365e744b (diff)
tipc: fix nullptr crash during subscription cancel
commit 4d5cfcba2f6e ('tipc: fix connection abort during subscription cancel'), removes the check for a valid subscription before calling tipc_nametbl_subscribe(). This will lead to a nullptr exception when we process a subscription cancel request. For a cancel request, a null subscription is passed to tipc_nametbl_subscribe() resulting in exception. In this commit, we call tipc_nametbl_subscribe() only for a valid subscription. Fixes: 4d5cfcba2f6e ('tipc: fix connection abort during subscription cancel') Reported-by: Anders Widell <> Signed-off-by: Parthasarathy Bhuvaragan <> Acked-by: Jon Maloy <> Signed-off-by: David S. Miller <>
Diffstat (limited to 'net')
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 69ee2eeef968..f9ff73a8d815 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -296,7 +296,8 @@ static void tipc_subscrb_rcv_cb(struct net *net, int conid,
if (tipc_subscrp_create(net, (struct tipc_subscr *)buf, subscrb, &sub))
return tipc_conn_terminate(tn->topsrv, subscrb->conid);
- tipc_nametbl_subscribe(sub);
+ if (sub)
+ tipc_nametbl_subscribe(sub);
/* Handle one request to establish a new subscriber */