qlcnic: silence false positive overflow warning
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
@@ -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)
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 warningWe actually store the MAC address as well as the
board_namehere. The longestboard_nameis 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
Signed-off-by Dan Carpenter <[email protected]>---
I'm not sure if this is worth sending. Feel free to drop this if you want.
David Miller
maintainerFrom: 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_namehere. The longestboard_nameis 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 <[email protected]>
This patch doesn't apply cleanly to any of my trees.
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
@@ -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)
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_namehere. The longestboard_nameis 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 <[email protected]>
Applied, thanks Dan.