In case of multiple FCFs, the newly allocated lnode by csio_lnode_alloc() is completely ignored during link up event. Fix it. This patch also fixes mbox memory reference after free. Signed-off-by: Praveen Madhavan <praveenm@xxxxxxxxxxx> --- drivers/scsi/csiostor/csio_hw.c | 2 +- drivers/scsi/csiostor/csio_lnode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c index 622bdab..d920267 100644 --- a/drivers/scsi/csiostor/csio_hw.c +++ b/drivers/scsi/csiostor/csio_hw.c @@ -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", @@ -1805,6 +1804,7 @@ csio_hw_use_fwconfig(struct csio_hw *hw, int reset, u32 *fw_cfg_param) csio_info(hw, "Successfully configure using Firmware " "Configuration File %s, version %#x, computed checksum %#x\n", config_name, finiver, cfcsum); + mempool_free(mbp, hw->mb_mempool); return 0; /* diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c index c00b2ff..3b02188 100644 --- a/drivers/scsi/csiostor/csio_lnode.c +++ b/drivers/scsi/csiostor/csio_lnode.c @@ -873,7 +873,7 @@ csio_handle_link_up(struct csio_hw *hw, uint8_t portid, uint32_t fcfi, if (ln->vnp_flowid != CSIO_INVALID_IDX) { /* New VN-Port */ spin_unlock_irq(&hw->lock); - csio_lnode_alloc(hw); + ln = csio_lnode_alloc(hw); spin_lock_irq(&hw->lock); if (!ln) { csio_err(hw, -- 2.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html