mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
msm: ipa3: Handle race condition to avoid NULL access
Updated change to avoid race condition and NULL pointer access, In case of SSR and ioctl call while performing QMI transaction. Change-Id: I09dbf33d76a3a0d9e4917e62aaf1257a1abe2db9 Signed-off-by: Raghavendar rao l <quic_rlomte@quicinc.com>
This commit is contained in:
parent
c36b185506
commit
1a79536d0e
1 changed files with 12 additions and 7 deletions
|
|
@ -467,14 +467,22 @@ static int ipa3_qmi_send_req_wait(struct qmi_handle *client_handle,
|
|||
struct qmi_txn txn;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&ipa3_qmi_lock);
|
||||
|
||||
if (!client_handle) {
|
||||
|
||||
mutex_unlock(&ipa3_qmi_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = qmi_txn_init(client_handle, &txn, resp_desc->ei_array, resp);
|
||||
|
||||
if (ret < 0) {
|
||||
IPAWANERR("QMI txn init failed, ret= %d\n", ret);
|
||||
mutex_unlock(&ipa3_qmi_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mutex_lock(&ipa3_qmi_lock);
|
||||
ret = qmi_send_request(client_handle,
|
||||
&ipa3_qmi_ctx->server_sq,
|
||||
&txn,
|
||||
|
|
@ -483,19 +491,16 @@ static int ipa3_qmi_send_req_wait(struct qmi_handle *client_handle,
|
|||
req_desc->ei_array,
|
||||
req);
|
||||
|
||||
if (unlikely(!ipa_q6_clnt)) {
|
||||
mutex_unlock(&ipa3_qmi_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_unlock(&ipa3_qmi_lock);
|
||||
|
||||
if (ret < 0) {
|
||||
qmi_txn_cancel(&txn);
|
||||
mutex_unlock(&ipa3_qmi_lock);
|
||||
return ret;
|
||||
}
|
||||
ret = qmi_txn_wait(&txn, msecs_to_jiffies(timeout_ms));
|
||||
|
||||
ret = qmi_txn_wait(&txn, msecs_to_jiffies(timeout_ms));
|
||||
mutex_unlock(&ipa3_qmi_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue