diff options
author | Arun Kumar Neelakantam <aneela@codeaurora.org> | 2018-10-03 01:40:02 -0400 |
---|---|---|
committer | Andy Gross <andy.gross@linaro.org> | 2018-11-14 13:02:07 -0500 |
commit | c4fe17e0e3a346cc855b7b41c00ff7b04c56d32b (patch) | |
tree | 0f0eea974b98395a412c3ab1a682e2127970e4c9 /drivers/soc/qcom/qmi_interface.c | |
parent | e0f2cfeb59c81cbcfc7fbcb7ec0636020499813b (diff) |
soc: qcom: qmi_interface: Limit txn ids to U16_MAX
Txn IDs created up to INT_MAX cause overflow while storing
the IDs in u16 type supported by QMI header.
Limit the txn IDs max value to U16_MAX to avoid overflow.
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers/soc/qcom/qmi_interface.c')
-rw-r--r-- | drivers/soc/qcom/qmi_interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/qcom/qmi_interface.c b/drivers/soc/qcom/qmi_interface.c index 938ca41c56cd..c239a28e503f 100644 --- a/drivers/soc/qcom/qmi_interface.c +++ b/drivers/soc/qcom/qmi_interface.c | |||
@@ -318,7 +318,7 @@ int qmi_txn_init(struct qmi_handle *qmi, struct qmi_txn *txn, | |||
318 | txn->dest = c_struct; | 318 | txn->dest = c_struct; |
319 | 319 | ||
320 | mutex_lock(&qmi->txn_lock); | 320 | mutex_lock(&qmi->txn_lock); |
321 | ret = idr_alloc_cyclic(&qmi->txns, txn, 0, INT_MAX, GFP_KERNEL); | 321 | ret = idr_alloc_cyclic(&qmi->txns, txn, 0, U16_MAX, GFP_KERNEL); |
322 | if (ret < 0) | 322 | if (ret < 0) |
323 | pr_err("failed to allocate transaction id\n"); | 323 | pr_err("failed to allocate transaction id\n"); |
324 | 324 | ||