net/qlcnic: Fix a use after free in qlcnic_83xx_get_minidump_template
authorLv Yunlong <lyl2019@mail.ustc.edu.cn>
Thu, 11 Mar 2021 04:01:40 +0000 (20:01 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Mar 2021 02:08:14 +0000 (18:08 -0800)
commitdb74623a3850db99cb9692fda9e836a56b74198d
treedea5167a4858fbbd861e8448bdacd7833d2b6bb2
parentce6c13e4f5b9d26e77f8ffcf9cf8e904d7658d9b
net/qlcnic: Fix a use after free in qlcnic_83xx_get_minidump_template

In qlcnic_83xx_get_minidump_template, fw_dump->tmpl_hdr was freed by
vfree(). But unfortunately, it is used when extended is true.

Fixes: 7061b2bdd620e ("qlogic: Deletion of unnecessary checks before two function calls")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c