From patchwork Fri Sep 4 13:59:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Praveen Madhavan X-Patchwork-Id: 7123761 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E815EBEEC1 for ; Fri, 4 Sep 2015 14:00:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21488207F9 for ; Fri, 4 Sep 2015 14:00:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 392AE207E5 for ; Fri, 4 Sep 2015 14:00:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760101AbbIDN77 (ORCPT ); Fri, 4 Sep 2015 09:59:59 -0400 Received: from stargate.chelsio.com ([67.207.112.58]:22058 "EHLO stargate3.asicdesigners.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759243AbbIDN76 (ORCPT ); Fri, 4 Sep 2015 09:59:58 -0400 Received: from fcoe-test11.asicdesigners.com (fcoe-test11.blr.asicdesigners.com [10.193.185.180]) by stargate3.asicdesigners.com (8.13.8/8.13.8) with ESMTP id t84Dxo61026784; Fri, 4 Sep 2015 06:59:50 -0700 From: Praveen Madhavan To: linux-scsi@vger.kernel.org Cc: praveenm@chelsio.com, varun@chelsio.com, anish@chelsio.com, hariprasad@chelsio.com Subject: [PATCH 1/1] csiostor:Don't ignore the newly alloced lnode Date: Fri, 4 Sep 2015 19:29:45 +0530 Message-Id: <1441375185-9630-1-git-send-email-praveenm@chelsio.com> X-Mailer: git-send-email 2.0.2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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,