]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix connection abort during subscription cancel
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Wed, 27 Jan 2016 10:35:59 +0000 (11:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Jan 2016 20:14:21 +0000 (15:14 -0500)
commit41cd02b8c7e6dbac577c4382d3380e9abfecc69f
treec96b685f7e864b832eb3685157b082823876e0fc
parent59ac6c594b51f7fff238b791aa8de7a6f7d9584b
tipc: fix connection abort during subscription cancel

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 the subscription pointer (set in the function) instead
of the return code.

Unfortunately, the same function tipc_subscrp_create() handles
subscription cancel request. For a subscription cancellation request,
the subscription pointer cannot be set. Thus if a subscriber has
several subscriptions and cancels any of them, the connection is
terminated.

In this commit, we terminate the connection based on the return value
of tipc_subscrp_create().
Fixes: commit 53c917ed39eb ("tipc: fix nullpointer bug when subscribing to events")
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