| Submitter | Dan Carpenter |
|---|---|
| Date | Jan. 25, 2013, 6:41 a.m. |
| Message ID | <20130125064141.GB4882@elgon.mountain> |
| Download | mbox | patch |
| Permalink | /patch/215560/ |
| State | Changes Requested |
| Delegated to: | David Miller |
| Headers | show |
Comments
>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> -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Patch
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)
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. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html