mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
scsi: csiostor: fix use after free in csio_hw_use_fwconfig()
[ Upstream commita351e40b6d] mbp pointer is passed to csio_hw_validate_caps() so call mempool_free() after calling csio_hw_validate_caps(). Signed-off-by: Varun Prakash <varun@chelsio.com> Fixes:541c571fa2("csiostor:Use firmware version from cxgb4/t4fw_version.h") Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c8799579ff
commit
2fb42f008b
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user