/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2020 Broadcom
+ * Copyright(c) 2019-2021 Broadcom
* All rights reserved.
*/
&rptr_index,
&rptr_entry,
&num_of_entries);
- if (rc)
+ if (rc) {
+ /* Free the allocated index before returning */
+ stack_push(pool, index);
return -1;
+ }
PMD_DRV_LOG
(DEBUG,