netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] qlcnic: silence false positive overflow warning
@ 2013-01-25  6:41 Dan Carpenter
  2013-01-25 20:48 ` Jitendra Kalsaria
  2013-01-28  1:38 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2013-01-25  6:41 UTC (permalink / raw)
  To: Jitendra Kalsaria; +Cc: Sony Chacko, linux-driver, netdev, kernel-janitors

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)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [patch] qlcnic: silence false positive overflow warning
  2013-01-25  6:41 [patch] qlcnic: silence false positive overflow warning Dan Carpenter
@ 2013-01-25 20:48 ` Jitendra Kalsaria
  2013-01-28  1:38 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: Jitendra Kalsaria @ 2013-01-25 20:48 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Sony Chacko, Dept-Eng Linux Driver, netdev,
	kernel-janitors@vger.kernel.org

>From: Dan Carpenter [mailto:dan.carpenter@oracle.com] 
>Sent: Thursday, January 24, 2013 10:42 PM
>To: Jitendra Kalsaria
>Cc: Sony Chacko; Dept-Eng Linux Driver; netdev; kernel-janitors@vger.kernel.org
>Subject: [patch] qlcnic: silence false positive overflow warning
>
>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.

Acked-By: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] qlcnic: silence false positive overflow warning
  2013-01-25  6:41 [patch] qlcnic: silence false positive overflow warning Dan Carpenter
  2013-01-25 20:48 ` Jitendra Kalsaria
@ 2013-01-28  1:38 ` David Miller
  2013-01-31  8:14   ` [patch v2] " Dan Carpenter
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2013-01-28  1:38 UTC (permalink / raw)
  To: dan.carpenter
  Cc: jitendra.kalsaria, sony.chacko, linux-driver, netdev,
	kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 25 Jan 2013 09:41:42 +0300

> 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>

This patch doesn't apply cleanly to any of my trees.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [patch v2] qlcnic: silence false positive overflow warning
  2013-01-28  1:38 ` David Miller
@ 2013-01-31  8:14   ` Dan Carpenter
  2013-02-03  4:00     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2013-01-31  8:14 UTC (permalink / raw)
  To: Jitendra Kalsaria; +Cc: Sony Chacko, linux-driver, netdev, kernel-janitors

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>
Acked-By: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
---
v2: Rebased on current net-next.

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index f3deef0..6a59a11 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -1813,7 +1813,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct qlcnic_hardware_context *ahw;
 	int err, pci_using_dac = -1;
 	u32 capab2;
-	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)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [patch v2] qlcnic: silence false positive overflow warning
  2013-01-31  8:14   ` [patch v2] " Dan Carpenter
@ 2013-02-03  4:00     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-02-03  4:00 UTC (permalink / raw)
  To: dan.carpenter
  Cc: jitendra.kalsaria, sony.chacko, linux-driver, netdev,
	kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 31 Jan 2013 11:14:10 +0300

> 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>
> Acked-By: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

Applied, thanks Dan.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-03  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25  6:41 [patch] qlcnic: silence false positive overflow warning Dan Carpenter
2013-01-25 20:48 ` 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

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).