DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Stokes, Ian" <ian.stokes@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>
Subject: RE: [PATCH] net/ice: add check for null-pointer dereference
Date: Tue, 19 Nov 2024 11:57:15 +0000	[thread overview]
Message-ID: <MW6PR11MB8309902848DA3BC0C77855E792202@MW6PR11MB8309.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20241114113511.3729267-1-bruce.richardson@intel.com>

> Although it should never occur that the teid (scheduler node id) value
> for a txq is incorrect, put in a check for null following the scheduler
> node lookup in ice_tm_setup_txq_node. This provides some additional
> safety and should eliminate a coverity issue too.
> 
> Coverity issue: 448957
> Fixes: 715d449a965b ("net/ice: enhance Tx scheduler hierarchy support")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  drivers/net/ice/ice_tm.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c
> index 18ac324a61..ff3a6cd77f 100644
> --- a/drivers/net/ice/ice_tm.c
> +++ b/drivers/net/ice/ice_tm.c
> @@ -679,6 +679,10 @@ ice_tm_setup_txq_node(struct ice_pf *pf, struct
> ice_hw *hw, uint16_t qid, uint32
>  	struct ice_sched_node *hw_node = ice_sched_find_node_by_teid(hw-
> >port_info->root, teid);
>  	struct ice_tm_node *sw_node = find_node(pf->tm_conf.root, qid);
> 
> +	/* bad node teid passed */
> +	if (hw_node == NULL)
> +		return -ENOENT;
> +
>  	/* not configured in hierarchy */
>  	if (sw_node == NULL)
>  		return 0;

LGTM.

Acked-by: Ian Stokes <ian.stokes@intel.com>

> --
> 2.43.0


  reply	other threads:[~2024-11-19 11:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 11:35 Bruce Richardson
2024-11-19 11:57 ` Stokes, Ian [this message]
2024-11-19 12:05   ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW6PR11MB8309902848DA3BC0C77855E792202@MW6PR11MB8309.namprd11.prod.outlook.com \
    --to=ian.stokes@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).