Skip to contentSkip to conversation

qlcnic: silence false positive overflow warning

PATCH Superseded Dan Carpenter 3 participants 5 messages Jan 25, 2013 – Feb 3, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
I'm not sure if this is worth sending. Feel free to drop this if you want.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -1
index 7f63b5f..09870d4 100644
@@ -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)
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines

From: Dan Carpenter [mailto:[email protected]]
Sent: Thursday, January 24, 2013 10:42 PM
To: Jitendra Kalsaria
Cc: Sony Chacko; Dept-Eng Linux Driver; netdev; [email protected]
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.

Quoted 4 lines

---
I'm not sure if this is worth sending. Feel free to drop this if you want.

maintainer
#2 lore raw
In reply to Dan Carpenter

From: Dan Carpenter <[email protected]>
Date: Fri, 25 Jan 2013 09:41:42 +0300

Quoted 6 lines

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.

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

#3 lore raw

PATCH v2 1/1 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.

---
v2: Rebased on current net-next.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -1
index f3deef0..6a59a11 100644
@@ -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)
maintainer Applied
#4 lore raw

From: Dan Carpenter <[email protected]>
Date: Thu, 31 Jan 2013 11:14:10 +0300

Quoted 7 lines

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.

Applied, thanks Dan.