Commit f848d6dd authored by Sony Chacko's avatar Sony Chacko Committed by David S. Miller

qlcnic: Memory leak fix

Fix a memory leak in error path of pci info.
Signed-off-by: default avatarSony Chacko <sony.chacko@qlogic.com>
Signed-off-by: default avatarAnirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 53478fef
...@@ -464,8 +464,10 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter) ...@@ -464,8 +464,10 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
pfn = pci_info[i].id; pfn = pci_info[i].id;
if (pfn > QLCNIC_MAX_PCI_FUNC) if (pfn > QLCNIC_MAX_PCI_FUNC) {
return QL_STATUS_INVALID_PARAM; ret = QL_STATUS_INVALID_PARAM;
goto err_eswitch;
}
adapter->npars[pfn].active = (u8)pci_info[i].active; adapter->npars[pfn].active = (u8)pci_info[i].active;
adapter->npars[pfn].type = (u8)pci_info[i].type; adapter->npars[pfn].type = (u8)pci_info[i].type;
adapter->npars[pfn].phy_port = (u8)pci_info[i].default_port; adapter->npars[pfn].phy_port = (u8)pci_info[i].default_port;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment