diff options
| author | Jiachao Wu <jiacwu@codeaurora.org> | 2017-11-06 14:37:11 +0800 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-11-09 23:14:10 -0800 |
| commit | 346957ae88c71ca33992bcffa2f9521d1e915ba7 (patch) | |
| tree | b57dd274f9b861582c5f2df6a665d0f38629db30 | |
| parent | 92aabb98cbe4372acd36d9c72f7c9670406fd202 (diff) | |
qcacmn: Check endpoint index range
Check endpoint range before it be used.
If endpoint is unused return with error.
Change-Id: I2888b0b66c737df677f09040133503e8ace60510
CRs-Fixed: 2138465
| -rw-r--r-- | htc/htc_send.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/htc/htc_send.c b/htc/htc_send.c index c2c60003a8f9..551ff0e277d9 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -1410,7 +1410,14 @@ static inline QDF_STATUS __htc_send_pkt(HTC_HANDLE HTCHandle, return QDF_STATUS_E_INVAL; } - AR_DEBUG_ASSERT(pPacket->Endpoint < ENDPOINT_MAX); + if ((pPacket->Endpoint >= ENDPOINT_MAX) || + (pPacket->Endpoint <= ENDPOINT_UNUSED)) { + AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("%s endpoint is invalid\n", + __func__)); + AR_DEBUG_ASSERT(0); + return QDF_STATUS_E_INVAL; + } + pEndpoint = &target->endpoint[pPacket->Endpoint]; if (!pEndpoint->service_id) { |
