All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH] net/ice/base: fix null pointer dereferences for parser
  2021-10-13 10:34 [dpdk-dev] [PATCH] net/ice/base: fix null pointer dereferences for parser Junfeng Guo
@ 2021-10-13 10:29 ` Zhang, Qi Z
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2021-10-13 10:29 UTC (permalink / raw)
  To: Guo, Junfeng, Wu, Jingjing, Xing, Beilei
  Cc: dev@dpdk.org, stable@dpdk.org, Yigit, Ferruh



> -----Original Message-----
> From: Guo, Junfeng <junfeng.guo@intel.com>
> Sent: Wednesday, October 13, 2021 6:35 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>;
> Guo, Junfeng <junfeng.guo@intel.com>
> Subject: [PATCH] net/ice/base: fix null pointer dereferences for parser
> 
> Null-checking "p" suggests that it may be null, but it has already been
> dereferenced on all paths leading to the check. Thus correct the code lines and
> remove the redundant line.
> 
> Fixes: c84f8aa2100c ("net/ice/base: add parser runtime skeleton")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-dev] [PATCH] net/ice/base: fix null pointer dereferences for parser
@ 2021-10-13 10:34 Junfeng Guo
  2021-10-13 10:29 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Junfeng Guo @ 2021-10-13 10:34 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, beilei.xing
  Cc: dev, stable, ferruh.yigit, junfeng.guo

Null-checking "p" suggests that it may be null, but it has already
been dereferenced on all paths leading to the check. Thus correct
the code lines and remove the redundant line.

Fixes: c84f8aa2100c ("net/ice/base: add parser runtime skeleton")
Cc: stable@dpdk.org

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/ice/base/ice_parser.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ice/base/ice_parser.c b/drivers/net/ice/base/ice_parser.c
index 690004e6e2..9b106baff0 100644
--- a/drivers/net/ice/base/ice_parser.c
+++ b/drivers/net/ice/base/ice_parser.c
@@ -167,13 +167,11 @@ enum ice_status ice_parser_create(struct ice_hw *hw, struct ice_parser **psr)
 	struct ice_parser *p;
 
 	p = (struct ice_parser *)ice_malloc(hw, sizeof(struct ice_parser));
-	p->hw = hw;
-	p->rt.psr = p;
-
 	if (!p)
 		return ICE_ERR_NO_MEMORY;
 
 	p->hw = hw;
+	p->rt.psr = p;
 
 	p->imem_table = ice_imem_table_get(hw);
 	if (!p->imem_table) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-13 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-13 10:34 [dpdk-dev] [PATCH] net/ice/base: fix null pointer dereferences for parser Junfeng Guo
2021-10-13 10:29 ` Zhang, Qi Z

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.