From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 1820523B
 for <dev@dpdk.org>; Mon, 30 Apr 2018 11:00:14 +0200 (CEST)
X-Amp-Result: UNKNOWN
X-Amp-Original-Verdict: FILE UNKNOWN
X-Amp-File-Uploaded: False
Received: from orsmga007.jf.intel.com ([10.7.209.58])
 by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 30 Apr 2018 02:00:12 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.49,346,1520924400"; d="scan'208";a="37209610"
Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.51])
 by orsmga007.jf.intel.com with SMTP; 30 Apr 2018 02:00:10 -0700
Received: by  (sSMTP sendmail emulation); Mon, 30 Apr 2018 10:00:09 +0100
Date: Mon, 30 Apr 2018 10:00:09 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net
Message-ID: <20180430090008.GB87372@bricha3-MOBL.ger.corp.intel.com>
References: <cover.1524650130.git.anatoly.burakov@intel.com>
 <cover.1524848343.git.anatoly.burakov@intel.com>
 <6aaf607fae1ee7c5c80000891d63f6b7992ab33b.1524848343.git.anatoly.burakov@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <6aaf607fae1ee7c5c80000891d63f6b7992ab33b.1524848343.git.anatoly.burakov@intel.com>
Organization: Intel Research and Development Ireland Ltd.
User-Agent: Mutt/1.9.4 (2018-02-28)
Subject: Re: [dpdk-dev] [PATCH v4 3/9] mem: fix potential double close
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Apr 2018 09:00:15 -0000

On Fri, Apr 27, 2018 at 06:07:04PM +0100, Anatoly Burakov wrote:
> We were closing descriptor before checking if mapping has
> failed, but if it did, we did a second close afterwards. Fix
> it by moving closing descriptor to after we've done all error
> checks.
> 
> Coverity issue: 272560
> 
> Fixes: 2a04139f66b4 ("eal: add single file segments option")
> Cc: anatoly.burakov@intel.com
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
> 
> Notes:
>     v4:
>     - Moved fd close to until after all error checks are done
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>