]> 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)
commitb2fb6023897a331bead13fa44d25d511c1e82be1
tree88417ce5ac52d5186d9b0065b0ef159cbc159dc7
parent2ccd09a626bf5d0e7073904cd6f3f2a161551b35
tipc: fix connection abort during subscription cancellation

In 'commit 53c917ed39eb ("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 53c917ed39eb ("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