Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/cxgbe: fix dangling pointer by mailbox access rework
[ upstream commit 19cafed ] Rework mailbox access serialization to dynamically allocate and free mbox entry. Also remove unnecessary temp memory and macros. Observed with: gcc-12.0 (GCC) 12.0.1 20220118 (experimental) In file included from ../lib/eal/linux/include/rte_os.h:14, from ../lib/eal/include/rte_common.h:28, from ../lib/eal/include/rte_log.h:25, from ../lib/ethdev/rte_ethdev.h:164, from ../lib/ethdev/ethdev_driver.h:18, from ../drivers/net/cxgbe/base/t4vf_hw.c:6: In function ‘t4_os_atomic_add_tail’, inlined from ‘t4vf_wr_mbox_core’ at ../drivers/net/cxgbe/base/t4vf_hw.c:115:2: ../drivers/net/cxgbe/base/adapter.h:742:9: warning: storing the address of local variable ‘entry’ in ‘((struct mbox_list *)adapter)[96].tqh_last’ [-Wdangling-pointer=] 742 | TAILQ_INSERT_TAIL(head, entry, next); | ^~~~~~~~~~~~~~~~~ ../drivers/net/cxgbe/base/t4vf_hw.c: In function ‘t4vf_wr_mbox_core’: ../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘entry’ declared here 86 | struct mbox_entry entry; | ^~~~~ ../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘adapter’ declared here Fixes: 3bd122e ("cxgbe/base: add hardware API for Chelsio T5 series adapters") Reported-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
- Loading branch information
1 parent
ef94549
commit 699c30f
Showing
3 changed files
with
49 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters