virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Zhu Lingshan <lingshan.zhu@intel.com>,
	jasowang@redhat.com, mst@redhat.com
Cc: kbuild-all@lists.01.org, lkp@intel.com, kvm@vger.kernel.org,
	netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Zhu Lingshan <lingshan.zhu@intel.com>
Subject: Re: [PATCH] vhost: new vhost_vdpa SET/GET_BACKEND_FEATURES handlers
Date: Wed, 9 Sep 2020 20:23:54 +0300	[thread overview]
Message-ID: <20200909172354.GA12635@kadam> (raw)
In-Reply-To: <20200909022233.26559-1-lingshan.zhu@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2005 bytes --]

Hi Zhu,

url:    https://github.com/0day-ci/linux/commits/Zhu-Lingshan/vhost-new-vhost_vdpa-SET-GET_BACKEND_FEATURES-handlers/20200909-115726
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: parisc-randconfig-m031-20200909 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/vhost/vdpa.c:356 vhost_vdpa_get_backend_features() warn: maybe return -EFAULT instead of the bytes remaining?

# https://github.com/0day-ci/linux/commit/f2da8fc35b4ef003de7d559a8c7730fedf9926f8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Zhu-Lingshan/vhost-new-vhost_vdpa-SET-GET_BACKEND_FEATURES-handlers/20200909-115726
git checkout f2da8fc35b4ef003de7d559a8c7730fedf9926f8
vim +356 drivers/vhost/vdpa.c

f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  348  static long vhost_vdpa_get_backend_features(void __user *argp)
f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  349  {
f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  350  	u64 features = VHOST_VDPA_BACKEND_FEATURES;
f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  351  	u64 __user *featurep = argp;
f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  352  	long r;
f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  353  
f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  354  	r = copy_to_user(featurep, &features, sizeof(features));
f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  355  
f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 @356  	return r;

copy_to_user() returns the number of bytes remaining.  I haven't looked
at how this is called but it should probably return negative error codes
on error:

	if (copy_to_user(featurep, &features, sizeof(features)))
		return -EFAULT;

	return 0;

f2da8fc35b4ef0 Zhu Lingshan 2020-09-09  357  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30628 bytes --]

[-- Attachment #3: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

      parent reply	other threads:[~2020-09-09 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200909022233.26559-1-lingshan.zhu@intel.com>
2020-09-09  2:38 ` [PATCH] vhost: new vhost_vdpa SET/GET_BACKEND_FEATURES handlers Jason Wang
2020-09-09 17:23 ` Dan Carpenter [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=20200909172354.GA12635@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=jasowang@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kvm@vger.kernel.org \
    --cc=lingshan.zhu@intel.com \
    --cc=lkp@intel.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).