tipc: fix nullptr crash during subscription cancel
commit4d5cfcba2f
('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:4d5cfcba2f
('tipc: fix connection abort during subscription cancel') Reported-by: Anders Widell <anders.widell@ericsson.com> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
11f7f79b40
commit
4de13d7ed6
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue