From: Tim Gardner <tim.gardner@canonical.com>
To: pkushwaha@marvell.com
Cc: tim.gardner@canonical.com, Ariel Elior <aelior@marvell.com>,
GR-everest-linux-l2@marvell.com,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Shai Malin <smalin@marvell.com>,
Omkar Kulkarni <okulkarni@marvell.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2][next] qed: Initialize debug string array
Date: Thu, 7 Oct 2021 06:04:13 -0600 [thread overview]
Message-ID: <20211007120413.8642-1-tim.gardner@canonical.com> (raw)
In-Reply-To: <MWHPR18MB10712FAF925C572621A5B1EDB2B19@MWHPR18MB1071.namprd18.prod.outlook.com>
Coverity complains of an uninitialized variable.
CID 120847 (#1 of 1): Uninitialized scalar variable (UNINIT)
3. uninit_use_in_call: Using uninitialized value *sw_platform_str when calling qed_dump_str_param. [show details]
1344 offset += qed_dump_str_param(dump_buf + offset,
1345 dump, "sw-platform", sw_platform_str);
Fix this by removing dead code that references sw_platform_str.
Fixes: 6c95dd8f0aa1d ("qed: Update debug related changes")
Cc: Ariel Elior <aelior@marvell.com>
Cc: GR-everest-linux-l2@marvell.com
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Shai Malin <smalin@marvell.com>
Cc: Omkar Kulkarni <okulkarni@marvell.com>
Cc: Prabhakar Kushwaha <pkushwaha@marvell.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org (open list)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
v2 - Arrive at the propoer fix per Prabhakar's suggestion.
---
drivers/net/ethernet/qlogic/qed/qed_debug.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c
index 6d693ee380f1..f6198b9a1b02 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_debug.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c
@@ -1315,7 +1315,6 @@ static u32 qed_dump_common_global_params(struct qed_hwfn *p_hwfn,
u8 num_specific_global_params)
{
struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
- char sw_platform_str[MAX_SW_PLTAFORM_STR_SIZE];
u32 offset = 0;
u8 num_params;
@@ -1341,8 +1340,6 @@ static u32 qed_dump_common_global_params(struct qed_hwfn *p_hwfn,
dump,
"platform",
s_hw_type_defs[dev_data->hw_type].name);
- offset += qed_dump_str_param(dump_buf + offset,
- dump, "sw-platform", sw_platform_str);
offset += qed_dump_num_param(dump_buf + offset,
dump, "pci-func", p_hwfn->abs_pf_id);
offset += qed_dump_num_param(dump_buf + offset,
--
2.33.0
next prev parent reply other threads:[~2021-10-07 12:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-06 14:02 [PATCH][next][RFC] qed: Initialize debug string array Tim Gardner
2021-10-07 5:11 ` [EXT] " Prabhakar Kushwaha
2021-10-07 12:04 ` Tim Gardner [this message]
2021-10-08 14:20 ` [PATCH v2][next] " patchwork-bot+netdevbpf
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=20211007120413.8642-1-tim.gardner@canonical.com \
--to=tim.gardner@canonical.com \
--cc=GR-everest-linux-l2@marvell.com \
--cc=aelior@marvell.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=okulkarni@marvell.com \
--cc=pkushwaha@marvell.com \
--cc=smalin@marvell.com \
/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).