Commit cc1ecce5 authored by Varun Prakash's avatar Varun Prakash Committed by Stefan Bader

scsi: csiostor: fix use after free in csio_hw_use_fwconfig()

BugLink: http://bugs.launchpad.net/bugs/1765010

[ Upstream commit a351e40b ]

mbp pointer is passed to csio_hw_validate_caps() so call mempool_free()
after calling csio_hw_validate_caps().
Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
Fixes: 541c571f ("csiostor:Use firmware version from cxgb4/t4fw_version.h")
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent c75d7bba
......@@ -1769,7 +1769,6 @@ csio_hw_use_fwconfig(struct csio_hw *hw, int reset, u32 *fw_cfg_param)
goto bye;
}
mempool_free(mbp, hw->mb_mempool);
if (finicsum != cfcsum) {
csio_warn(hw,
"Config File checksum mismatch: csum=%#x, computed=%#x\n",
......@@ -1780,6 +1779,10 @@ csio_hw_use_fwconfig(struct csio_hw *hw, int reset, u32 *fw_cfg_param)
rv = csio_hw_validate_caps(hw, mbp);
if (rv != 0)
goto bye;
mempool_free(mbp, hw->mb_mempool);
mbp = NULL;
/*
* Note that we're operating with parameters
* not supplied by the driver, rather than from hard-wired
......
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