* [dpdk-stable] [PATCH] eal: don't log uninitialized string
@ 2020-12-11 17:06 Andrew Boyer
2020-12-14 23:23 ` [dpdk-stable] [dpdk-dev] " Mcnamara, John
2021-01-06 9:35 ` [dpdk-stable] " David Marchand
0 siblings, 2 replies; 3+ messages in thread
From: Andrew Boyer @ 2020-12-11 17:06 UTC (permalink / raw)
To: dev; +Cc: Andrew Boyer, anatoly.burakov, stable
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);
return -1;
}
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH] eal: don't log uninitialized string
2020-12-11 17:06 [dpdk-stable] [PATCH] eal: don't log uninitialized string Andrew Boyer
@ 2020-12-14 23:23 ` Mcnamara, John
2021-01-06 9:35 ` [dpdk-stable] " David Marchand
1 sibling, 0 replies; 3+ messages in thread
From: Mcnamara, John @ 2020-12-14 23:23 UTC (permalink / raw)
To: Andrew Boyer, dev; +Cc: Burakov, Anatoly, stable
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Andrew Boyer
> Sent: Friday, December 11, 2020 5:06 PM
> To: dev@dpdk.org
> Cc: Andrew Boyer <aboyer@pensando.io>; Burakov, Anatoly
> <anatoly.burakov@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] eal: don't log uninitialized string
>
> 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.
I double checked and I can confirm that this wasn't picked up by any of the public scans, even though 4 other issues in that file were. So thanks for the fix.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] eal: don't log uninitialized string
2020-12-11 17:06 [dpdk-stable] [PATCH] eal: don't log uninitialized string Andrew Boyer
2020-12-14 23:23 ` [dpdk-stable] [dpdk-dev] " Mcnamara, John
@ 2021-01-06 9:35 ` David Marchand
1 sibling, 0 replies; 3+ messages in thread
From: David Marchand @ 2021-01-06 9:35 UTC (permalink / raw)
To: Andrew Boyer, Burakov, Anatoly; +Cc: dev, dpdk stable
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-06 9:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 17:06 [dpdk-stable] [PATCH] eal: don't log uninitialized string Andrew Boyer
2020-12-14 23:23 ` [dpdk-stable] [dpdk-dev] " Mcnamara, John
2021-01-06 9:35 ` [dpdk-stable] " David Marchand
patches for DPDK stable branches
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
stable@dpdk.org
public-inbox-index stable
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://inbox.dpdk.org/inbox.dpdk.stable
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git