Merge "spcom: avoid using stale glink handle"
This commit is contained in:
commit
f8bec54357
1 changed files with 5 additions and 9 deletions
|
@ -493,13 +493,10 @@ static void spcom_notify_state(void *handle, const void *priv, unsigned event)
|
||||||
|
|
||||||
ch->glink_state = event;
|
ch->glink_state = event;
|
||||||
|
|
||||||
/*
|
if (!handle) {
|
||||||
* if spcom_notify_state() is called within glink_open()
|
pr_err("inavlid glink_handle, ch [%s].\n", ch->name);
|
||||||
* then ch->glink_handle is not updated yet.
|
mutex_unlock(&ch->lock);
|
||||||
*/
|
return;
|
||||||
if (!ch->glink_handle) {
|
|
||||||
pr_debug("update glink_handle, ch [%s].\n", ch->name);
|
|
||||||
ch->glink_handle = handle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* signal before unlock mutex & before calling glink */
|
/* signal before unlock mutex & before calling glink */
|
||||||
|
@ -512,8 +509,7 @@ static void spcom_notify_state(void *handle, const void *priv, unsigned event)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pr_debug("call glink_queue_rx_intent() ch [%s].\n", ch->name);
|
pr_debug("call glink_queue_rx_intent() ch [%s].\n", ch->name);
|
||||||
ret = glink_queue_rx_intent(ch->glink_handle,
|
ret = glink_queue_rx_intent(handle, ch, ch->rx_buf_size);
|
||||||
ch, ch->rx_buf_size);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_err("glink_queue_rx_intent() err [%d]\n", ret);
|
pr_err("glink_queue_rx_intent() err [%d]\n", ret);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue