Skip to content

Commit 5f46fea

Browse files
Dan Carpenterdavem330
authored andcommitted
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: d01a6d3 ('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>
1 parent 685764b commit 5f46fea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,7 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
14171417
struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump;
14181418
struct pci_dev *pdev = adapter->pdev;
14191419
bool extended = false;
1420+
int ret;
14201421

14211422
prev_version = adapter->fw_version;
14221423
current_version = qlcnic_83xx_get_fw_version(adapter);
@@ -1427,8 +1428,11 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
14271428
if (qlcnic_83xx_md_check_extended_dump_capability(adapter))
14281429
extended = !qlcnic_83xx_extend_md_capab(adapter);
14291430

1430-
if (!qlcnic_fw_cmd_get_minidump_temp(adapter))
1431-
dev_info(&pdev->dev, "Supports FW dump capability\n");
1431+
ret = qlcnic_fw_cmd_get_minidump_temp(adapter);
1432+
if (ret)
1433+
return;
1434+
1435+
dev_info(&pdev->dev, "Supports FW dump capability\n");
14321436

14331437
/* Once we have minidump template with extended iSCSI dump
14341438
* capability, update the minidump capture mask to 0x1f as

0 commit comments

Comments
 (0)