aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-05-10 15:20:04 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-11 23:44:56 -0400
commit5f46feab87bb105d6a217d966b327fdc56696802 (patch)
treee169b1e6f9d9ba111144ee3a5ed96fe353278685
parent685764b108a7e5fe9f5ee213d6a627c1166d7c88 (diff)
qlcnic: potential NULL dereference in qlcnic_83xx_get_minidump_template()
If qlcnic_fw_cmd_get_minidump_temp() fails then "fw_dump->tmpl_hdr" is NULL or possibly freed. It can lead to an oops later. Fixes: d01a6d3c8ae1 ('qlcnic: Add support to enable capability to extend minidump for iSCSI') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
index cda9e604a95f..0844b7c75767 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
@@ -1417,6 +1417,7 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
1417 struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump; 1417 struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump;
1418 struct pci_dev *pdev = adapter->pdev; 1418 struct pci_dev *pdev = adapter->pdev;
1419 bool extended = false; 1419 bool extended = false;
1420 int ret;
1420 1421
1421 prev_version = adapter->fw_version; 1422 prev_version = adapter->fw_version;
1422 current_version = qlcnic_83xx_get_fw_version(adapter); 1423 current_version = qlcnic_83xx_get_fw_version(adapter);
@@ -1427,8 +1428,11 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
1427 if (qlcnic_83xx_md_check_extended_dump_capability(adapter)) 1428 if (qlcnic_83xx_md_check_extended_dump_capability(adapter))
1428 extended = !qlcnic_83xx_extend_md_capab(adapter); 1429 extended = !qlcnic_83xx_extend_md_capab(adapter);
1429 1430
1430 if (!qlcnic_fw_cmd_get_minidump_temp(adapter)) 1431 ret = qlcnic_fw_cmd_get_minidump_temp(adapter);
1431 dev_info(&pdev->dev, "Supports FW dump capability\n"); 1432 if (ret)
1433 return;
1434
1435 dev_info(&pdev->dev, "Supports FW dump capability\n");
1432 1436
1433 /* Once we have minidump template with extended iSCSI dump 1437 /* Once we have minidump template with extended iSCSI dump
1434 * capability, update the minidump capture mask to 0x1f as 1438 * capability, update the minidump capture mask to 0x1f as