]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:15 +0000 (15:45 -0700)
commit422a41e0244e48a6af5686ca22cbe7e05872a861
tree6e88a65c1fb0530d536cfb8ded4aaa301470d1d3
parent29adc97a03d89457698a828bb0ed4244027d0c07
tipc: fix connection abort during subscription cancel

Orabug: 23330935

[ Upstream commit 4d5cfcba2f6ec494d8810b9e3c0a7b06255c8067 ]

In 'commit 7fe8097cef5f ("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 7fe8097cef5f ("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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 257a04782588b4b97ac005a044f85947f792be44)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
net/tipc/subscr.c