* [dpdk-dev] [PATCH] common/sfc_efx/base: fix the problem of using null pointer
@ 2021-04-25 12:58 Min Hu (Connor)
2021-04-27 15:23 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Min Hu (Connor) @ 2021-04-25 12:58 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, andrew.rybchenko
From: HongBo Zheng <zhenghongbo3@huawei.com>
In function efx_pci_xilinx_cap_tbl_find, pointer entry_offsetp is used
before null pointer check, which may cause access to null pointer.
This patch fix this problem.
Fixes: ba9568b8b4b7 ("common/sfc_efx/base: add Xilinx capabilities table lookup")
Cc: stable@dpdk.org
Signed-off-by: HongBo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/common/sfc_efx/base/efx_pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/common/sfc_efx/base/efx_pci.c b/drivers/common/sfc_efx/base/efx_pci.c
index 8a26da6..9c7cacb 100644
--- a/drivers/common/sfc_efx/base/efx_pci.c
+++ b/drivers/common/sfc_efx/base/efx_pci.c
@@ -310,7 +310,7 @@ efx_pci_xilinx_cap_tbl_find(
__in boolean_t skip_first,
__inout efsys_dma_addr_t *entry_offsetp)
{
- efsys_dma_addr_t offset = *entry_offsetp;
+ efsys_dma_addr_t offset;
boolean_t skip = skip_first;
efx_qword_t header;
uint32_t format;
@@ -322,6 +322,7 @@ efx_pci_xilinx_cap_tbl_find(
goto fail1;
}
+ offset = *entry_offsetp;
rc = ENOENT;
/*
* SF-119689-TC Riverhead Host Interface section 4.2.2.
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] common/sfc_efx/base: fix the problem of using null pointer
2021-04-25 12:58 [dpdk-dev] [PATCH] common/sfc_efx/base: fix the problem of using null pointer Min Hu (Connor)
@ 2021-04-27 15:23 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2021-04-27 15:23 UTC (permalink / raw)
To: Min Hu (Connor), dev; +Cc: andrew.rybchenko
On 4/25/2021 1:58 PM, Min Hu (Connor) wrote:
> From: HongBo Zheng <zhenghongbo3@huawei.com>
>
> In function efx_pci_xilinx_cap_tbl_find, pointer entry_offsetp is used
> before null pointer check, which may cause access to null pointer.
>
> This patch fix this problem.
>
> Fixes: ba9568b8b4b7 ("common/sfc_efx/base: add Xilinx capabilities table lookup")
> Cc: stable@dpdk.org
>
> Signed-off-by: HongBo Zheng <zhenghongbo3@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-27 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 12:58 [dpdk-dev] [PATCH] common/sfc_efx/base: fix the problem of using null pointer Min Hu (Connor)
2021-04-27 15:23 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).