From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6F0185699 for ; Mon, 20 Jun 2016 09:20:08 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 20 Jun 2016 00:19:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,497,1459839600"; d="scan'208";a="125130267" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga004.fm.intel.com with ESMTP; 20 Jun 2016 00:19:57 -0700 Date: Mon, 20 Jun 2016 15:20:51 +0800 From: Yuanhan Liu To: Huawei Xie Cc: dev@dpdk.org, michalx.k.jastrzebski@intel.com Message-ID: <20160620072051.GF23111@yliu-dev.sh.intel.com> References: <1465926323-30532-1-git-send-email-huawei.xie@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465926323-30532-1-git-send-email-huawei.xie@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] vhost: fix unchecked return value of fstat X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 07:20:08 -0000 On Wed, Jun 15, 2016 at 01:45:23AM +0800, Huawei Xie wrote: > Value returned from fstat is not checked for errors before being used. > Fixes the coverity issue: > > static uint64_t > get_blk_size(int fd) > { > struct stat stat; > > fstat(fd, &stat); > return (uint64_t)stat.st_blksize; > >>> CID 107103 (#1 of 1): Unchecked return value from library (CHECKED_RETURN) > >>> check_return: Calling fstat(fd, &stat) without checking return value. > >>> This library function may fail and return an error code. > > Fixes: 8f972312b8f4 ("vhost: support vhost-user") > > Signed-off-by: Huawei Xie Acked-by: Yuanhan Liu Applied to dpdk-next-virtio. Thanks. --yliu