All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Huawei Xie <huawei.xie@intel.com>
Cc: dev@dpdk.org, michalx.k.jastrzebski@intel.com
Subject: Re: [PATCH] vhost: fix unchecked return value of fstat
Date: Mon, 20 Jun 2016 15:20:51 +0800	[thread overview]
Message-ID: <20160620072051.GF23111@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <1465926323-30532-1-git-send-email-huawei.xie@intel.com>

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 <huawei.xie@intel.com>

Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>

Applied to dpdk-next-virtio. Thanks.

	--yliu

      reply	other threads:[~2016-06-20  7:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 17:45 [PATCH] vhost: fix unchecked return value of fstat Huawei Xie
2016-06-20  7:20 ` Yuanhan Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160620072051.GF23111@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.com \
    --cc=michalx.k.jastrzebski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.