rpmsg: glink: fix destroy channel endpoint logic

When rpmsg client driver destroys last channel endpoint, remove rpmsg
device is triggered. In both cases (destroy endpoint and remove device)
a glink close command sent to the remote peer.

This change, when for removing rpmsg device endpoint already destroyed
will avoid sending second glink close command.

Change-Id: I0135e2626f4ede7a380308944f7c273d18e223bf
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
This commit is contained in:
Konstantin Dorfman 2019-01-10 11:07:46 +02:00 committed by Chris Lew
parent 4e40649bf5
commit 0174e84b16

View File

@ -1275,6 +1275,10 @@ static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
unsigned long flags;
spin_lock_irqsave(&channel->recv_lock, flags);
if (!channel->ept.cb) {
spin_unlock_irqrestore(&channel->recv_lock, flags);
return;
}
channel->ept.cb = NULL;
spin_unlock_irqrestore(&channel->recv_lock, flags);