patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Andrew Boyer <aboyer@pensando.io>,
	"Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: dev <dev@dpdk.org>, dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] eal: don't log uninitialized string
Date: Wed, 6 Jan 2021 10:35:13 +0100	[thread overview]
Message-ID: <CAJFAV8wjYDivzMY=VcCb8f1LGd1X7FXfeKpWjZ9xbt_b_RHkVg@mail.gmail.com> (raw)
In-Reply-To: <20201211170615.32827-1-aboyer@pensando.io>

On Fri, Dec 11, 2020 at 6:07 PM Andrew Boyer <aboyer@pensando.io> wrote:
>
> Our Coverity scan pointed out that path[] is never initialized.
> The official DPDK Coverity has not reported this so there is
> no public CID for it.
>
> Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")
> Cc: anatoly.burakov@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Andrew Boyer <aboyer@pensando.io>
> ---
>  lib/librte_eal/common/eal_common_fbarray.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
> index 1220e2bae..6ce89af83 100644
> --- a/lib/librte_eal/common/eal_common_fbarray.c
> +++ b/lib/librte_eal/common/eal_common_fbarray.c
> @@ -83,11 +83,10 @@ get_used_mask(void *data, unsigned int elt_sz, unsigned int len)
>  static int
>  resize_and_map(int fd, void *addr, size_t len)
>  {
> -       char path[PATH_MAX];
>         void *map_addr;
>
>         if (eal_file_truncate(fd, len)) {
> -               RTE_LOG(ERR, EAL, "Cannot truncate %s\n", path);
> +               RTE_LOG(ERR, EAL, "Cannot truncate fd %d\n", fd);

Logging a fd number won't help much, but I guess this was not really
helpful with path[] either :-).
If we keep this log, I would move it to the callers of the functions,
where the filename is available.


-- 
David Marchand


  parent reply	other threads:[~2021-01-06  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 17:06 Andrew Boyer
2020-12-14 23:23 ` [dpdk-stable] [dpdk-dev] " Mcnamara, John
2021-01-06  9:35 ` David Marchand [this message]
2021-02-09 14:35   ` [dpdk-stable] " Andrew Boyer

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='CAJFAV8wjYDivzMY=VcCb8f1LGd1X7FXfeKpWjZ9xbt_b_RHkVg@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=aboyer@pensando.io \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --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).