]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix connection abort during subscription cancellation
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Tue, 2 Feb 2016 09:52:12 +0000 (10:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Feb 2016 08:41:58 +0000 (03:41 -0500)
commit6bb37f2992af480bb49cb189b978382dde1251c7
tree88417ce5ac52d5186d9b0065b0ef159cbc159dc7
parent2356943ef683b4e6e6bbe4dce8854e0d7b3f99c5
tipc: fix connection abort during subscription cancellation

In 'commit 704ae75ac3f5 ("tipc: fix nullpointer bug when subscribing
to events")', we terminate the connection if the subscription
creation fails.
In the same commit, the subscription creation result was based on
the value of subscription pointer (set in the function) instead of
the return code.

Unfortunately, the same function also handles subscription
cancellation request. For a subscription cancellation request,
the subscription pointer cannot be set. Thus the connection is
terminated during cancellation request.

In this commit, we move the subcription cancel check outside
of tipc_subscrp_create(). Hence,
- tipc_subscrp_create() will create a subscripton
- tipc_subscrb_rcv_cb() will subscribe or cancel a subscription.

Fixes: 'commit 704ae75ac3f5 ("tipc: fix nullpointer bug when subscribing to events")'
Acked-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/subscr.c