patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>, dev@dpdk.org
Cc: stable@dpdk.org, Apeksha Gupta <apeksha.gupta@nxp.com>
Subject: Re: [dpdk-stable] [PATCH v3 1/8] bus/fslmc: fix dereferencing null pointer
Date: Wed, 6 May 2020 22:14:14 +0100	[thread overview]
Message-ID: <6da491ce-d11e-afe5-c7e7-49ac1e9c7a60@intel.com> (raw)
In-Reply-To: <20200504124118.22877-2-hemant.agrawal@nxp.com>

On 5/4/2020 1:41 PM, Hemant Agrawal wrote:
> From: Apeksha Gupta <apeksha.gupta@nxp.com>
> 
> This patch fixees the nxp internal coverity reported
> null pointer dereferncing issue.
> 
> Fixes: 6fef517e17cf ("bus/fslmc: add qman HW fq query count API")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
> ---
>  drivers/bus/fslmc/qbman/qbman_debug.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/bus/fslmc/qbman/qbman_debug.c b/drivers/bus/fslmc/qbman/qbman_debug.c
> index 0bb2ce880f..34374ae4b6 100644
> --- a/drivers/bus/fslmc/qbman/qbman_debug.c
> +++ b/drivers/bus/fslmc/qbman/qbman_debug.c
> @@ -20,26 +20,27 @@ struct qbman_fq_query_desc {
>  	uint8_t verb;
>  	uint8_t reserved[3];
>  	uint32_t fqid;
> -	uint8_t reserved2[57];
> +	uint8_t reserved2[56];

Is decreasing 'reserved2' size related to null pointer de-referencing? This
looks unrelated.

>  };
>  
>  int qbman_fq_query_state(struct qbman_swp *s, uint32_t fqid,
>  			 struct qbman_fq_query_np_rslt *r)
>  {
>  	struct qbman_fq_query_desc *p;
> +	struct qbman_fq_query_np_rslt *var;
>  
>  	p = (struct qbman_fq_query_desc *)qbman_swp_mc_start(s);
>  	if (!p)
>  		return -EBUSY;
>  
>  	p->fqid = fqid;
> -	*r = *(struct qbman_fq_query_np_rslt *)qbman_swp_mc_complete(s, p,
> -						QBMAN_FQ_QUERY_NP);
> -	if (!r) {
> +	var = qbman_swp_mc_complete(s, p, QBMAN_FQ_QUERY_NP);
> +	if (!var) {
>  		pr_err("qbman: Query FQID %d NP fields failed, no response\n",
>  		       fqid);
>  		return -EIO;
>  	}
> +	*r = *var;
>  
>  	/* Decode the outcome */
>  	QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_FQ_QUERY_NP);
> 


  parent reply	other threads:[~2020-05-06 21:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200302145829.27808-1-hemant.agrawal@nxp.com>
2020-03-02 14:58 ` [dpdk-stable] [PATCH 01/16] net/dpaa2: fix 10g port negotiation issue Hemant Agrawal
2020-03-02 14:58 ` [dpdk-stable] [PATCH 02/16] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
     [not found] ` <20200306095742.18080-1-hemant.agrawal@nxp.com>
2020-03-06  9:57   ` [dpdk-stable] [PATCH v2 01/16] net/dpaa2: fix 10g port negotiation issue Hemant Agrawal
2020-03-06  9:57   ` [dpdk-stable] [PATCH v2 02/16] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
     [not found]   ` <20200504124118.22877-1-hemant.agrawal@nxp.com>
2020-05-04 12:41     ` [dpdk-stable] [PATCH v3 1/8] " Hemant Agrawal
2020-05-06 21:08       ` Ferruh Yigit
2020-05-06 21:09         ` Ferruh Yigit
2020-05-06 21:14       ` Ferruh Yigit [this message]
2020-05-04 12:41     ` [dpdk-stable] [PATCH v3 2/8] net/dpaa2: fix 10g port negotiation issue Hemant Agrawal
     [not found]     ` <20200507104645.31990-1-hemant.agrawal@nxp.com>
2020-05-07 10:46       ` [dpdk-stable] [PATCH v4 1/9] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
2020-05-07 10:46       ` [dpdk-stable] [PATCH v4 2/9] net/dpaa2: fix 10g port negotiation issue Hemant Agrawal
2020-05-07 14:36         ` Ferruh Yigit
2020-05-07 10:46       ` [dpdk-stable] [PATCH v4 8/9] net/dpaa2: fix cong group id for multiple tcs Hemant Agrawal
2020-05-07 14:33         ` Ferruh Yigit
2020-05-07 10:46       ` [dpdk-stable] [PATCH v4 9/9] bus/fslmc: fix the size of qman fq desc Hemant Agrawal
     [not found]       ` <20200508125934.14255-1-hemant.agrawal@nxp.com>
2020-05-08 12:59         ` [dpdk-stable] [PATCH v5 1/9] net/dpaa2: fix 10G port negotiation issue Hemant Agrawal
2020-05-08 12:59         ` [dpdk-stable] [PATCH v5 7/9] net/dpaa2: fix cong group id for multiple tcs Hemant Agrawal
2020-05-08 12:59         ` [dpdk-stable] [PATCH v5 8/9] bus/fslmc: fix the size of qman fq desc Hemant Agrawal
     [not found]       ` <20200508130211.14334-1-hemant.agrawal@nxp.com>
2020-05-08 13:02         ` [dpdk-stable] [PATCH v6 01/10] bus/fslmc: fix dereferencing null pointer Hemant Agrawal
2020-05-08 13:02         ` [dpdk-stable] [PATCH v6 02/10] net/dpaa2: fix 10G port negotiation issue Hemant Agrawal
2020-05-08 13:02         ` [dpdk-stable] [PATCH v6 08/10] net/dpaa2: fix cong group id for multiple tcs Hemant Agrawal
2020-05-08 13:02         ` [dpdk-stable] [PATCH v6 09/10] bus/fslmc: fix the size of qman fq desc Hemant Agrawal

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=6da491ce-d11e-afe5-c7e7-49ac1e9c7a60@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=apeksha.gupta@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=stable@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).