baseband/acc: fix possible overflow in queue release
Potential overflow issue when casting to 64bits, notably relevant when extending number of queues. Coverity issue: 381665 Fixes: 32e8b7ea35 ("baseband/acc100: refactor to segregate common code") Fixes: 40e3adbdd3 ("baseband/acc200: add queue configuration") Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
parent
e3e16275da
commit
4e63e38c62
@ -888,8 +888,7 @@ acc100_queue_release(struct rte_bbdev *dev, uint16_t q_id)
|
||||
|
||||
if (q != NULL) {
|
||||
/* Mark the Queue as un-assigned */
|
||||
d->q_assigned_bit_map[q->qgrp_id] &= (0xFFFFFFFFFFFFFFFF -
|
||||
(uint64_t) (1 << q->aq_id));
|
||||
d->q_assigned_bit_map[q->qgrp_id] &= (~0ULL - (1 << (uint64_t) q->aq_id));
|
||||
rte_free(q->companion_ring_addr);
|
||||
rte_free(q->lb_in);
|
||||
rte_free(q->lb_out);
|
||||
|
@ -964,7 +964,7 @@ acc200_queue_release(struct rte_bbdev *dev, uint16_t q_id)
|
||||
|
||||
if (q != NULL) {
|
||||
/* Mark the Queue as un-assigned. */
|
||||
d->q_assigned_bit_map[q->qgrp_id] &= (~0ULL - (uint64_t) (1 << q->aq_id));
|
||||
d->q_assigned_bit_map[q->qgrp_id] &= (~0ULL - (1 << (uint64_t) q->aq_id));
|
||||
rte_free(q->companion_ring_addr);
|
||||
rte_free(q->lb_in);
|
||||
rte_free(q->lb_out);
|
||||
|
Loading…
x
Reference in New Issue
Block a user