Commit f71c472a authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

qlcnic: potential NULL dereference in qlcnic_83xx_get_minidump_template()

BugLink: https://bugs.launchpad.net/bugs/1878232

commit 5f46feab upstream.

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: d01a6d3c ('qlcnic: Add support to enable capability to extend minidump for iSCSI')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 8b7c21de
...@@ -1419,6 +1419,7 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter) ...@@ -1419,6 +1419,7 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump; struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump;
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
bool extended = false; bool extended = false;
int ret;
prev_version = adapter->fw_version; prev_version = adapter->fw_version;
current_version = qlcnic_83xx_get_fw_version(adapter); current_version = qlcnic_83xx_get_fw_version(adapter);
...@@ -1429,7 +1430,10 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter) ...@@ -1429,7 +1430,10 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
if (qlcnic_83xx_md_check_extended_dump_capability(adapter)) if (qlcnic_83xx_md_check_extended_dump_capability(adapter))
extended = !qlcnic_83xx_extend_md_capab(adapter); extended = !qlcnic_83xx_extend_md_capab(adapter);
if (!qlcnic_fw_cmd_get_minidump_temp(adapter)) ret = qlcnic_fw_cmd_get_minidump_temp(adapter);
if (ret)
return;
dev_info(&pdev->dev, "Supports FW dump capability\n"); dev_info(&pdev->dev, "Supports FW dump capability\n");
/* Once we have minidump template with extended iSCSI dump /* Once we have minidump template with extended iSCSI dump
......
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