mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
scsi: csiostor: fix use after free in csio_hw_use_fwconfig()
mbp pointer is passed to csio_hw_validate_caps() so call mempool_free()
after calling csio_hw_validate_caps().
Signed-off-by: Varun Prakash <[email protected]>
Fixes: 541c571fa2 ("csiostor:Use firmware version from cxgb4/t4fw_version.h")
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
parent
463f620b12
commit
a351e40b6d
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue