From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Cc: Sony Chacko <sony.chacko@qlogic.com>,
linux-driver@qlogic.com, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [patch] qlcnic: silence false positive overflow warning
Date: Fri, 25 Jan 2013 09:41:42 +0300 [thread overview]
Message-ID: <20130125064141.GB4882@elgon.mountain> (raw)
We actually store the MAC address as well as the board_name here. The
longest board_name is 75 characters so there is more than enough room
to hold the 17 character MAC and the ": " divider. But making this
buffer larger silences a static checker warning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I'm not sure if this is worth sending. Feel free to drop this if you
want.
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 7f63b5f..09870d4 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -1724,7 +1724,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct qlcnic_adapter *adapter = NULL;
struct qlcnic_hardware_context *ahw;
int err, pci_using_dac = -1;
- char board_name[QLCNIC_MAX_BOARD_NAME_LEN];
+ char board_name[QLCNIC_MAX_BOARD_NAME_LEN + 19]; /* MAC + ": " + name */
err = pci_enable_device(pdev);
if (err)
next reply other threads:[~2013-01-25 6:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-25 6:41 Dan Carpenter [this message]
2013-01-25 20:48 ` [patch] qlcnic: silence false positive overflow warning Jitendra Kalsaria
2013-01-28 1:38 ` David Miller
2013-01-31 8:14 ` [patch v2] " Dan Carpenter
2013-02-03 4:00 ` David Miller
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=20130125064141.GB4882@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=jitendra.kalsaria@qlogic.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-driver@qlogic.com \
--cc=netdev@vger.kernel.org \
--cc=sony.chacko@qlogic.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