On 2020/6/2 äå5:42, Dan Carpenter wrote:
Hi Zhu,
url: https://github.com/0day-ci/linux/commits/Zhu-Lingshan/vdpa-bypass-waking-up-vhost_woker-for-vdpa-vq-kick/20200526-133819
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-randconfig-m001-20200529 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
smatch warnings:
drivers/vhost/vdpa.c:348 vhost_vdpa_set_vring_kick() error: uninitialized symbol 'r'.
# https://github.com/0day-ci/linux/commit/a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d
vim +/r +348 drivers/vhost/vdpa.c
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 316Â static long vhost_vdpa_set_vring_kick(struct vhost_virtqueue *vq,
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 317ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ void __user *argp)
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 318Â {
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 319ÂÂÂÂÂ bool pollstart = false, pollstop = false;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 320ÂÂÂÂÂ struct file *eventfp, *filep = NULL;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 321ÂÂÂÂÂ struct vhost_vring_file f;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 322ÂÂÂÂÂ long r;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 323
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 324ÂÂÂÂÂ if (copy_from_user(&f, argp, sizeof(f)))
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 325ÂÂÂÂÂÂÂÂÂ return -EFAULT;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 326
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 327ÂÂÂÂÂ eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd);
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 328ÂÂÂÂÂ if (IS_ERR(eventfp)) {
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 329ÂÂÂÂÂÂÂÂÂ r = PTR_ERR(eventfp);
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 330ÂÂÂÂÂÂÂÂÂ return r;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 331ÂÂÂÂÂ }
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 332
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 333ÂÂÂÂÂ if (eventfp != vq->kick) {
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 334ÂÂÂÂÂÂÂÂÂ pollstop = (filep = vq->kick) != NULL;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 335ÂÂÂÂÂÂÂÂÂ pollstart = (vq->kick = eventfp) != NULL;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 336ÂÂÂÂÂ } else
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 337ÂÂÂÂÂÂÂÂÂ filep = eventfp;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 338
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 339ÂÂÂÂÂ if (pollstop && vq->handle_kick)
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 340 vhost_vdpa_poll_stop(vq);
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 341
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 342ÂÂÂÂÂ if (filep)
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 343 fput(filep);
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 344
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 345ÂÂÂÂÂ if (pollstart && vq->handle_kick)
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 346ÂÂÂÂÂÂÂÂÂ r = vhost_vdpa_poll_start(vq);
"r" not initialized on else path.
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 347
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 @348ÂÂÂÂÂ return r;
a84ddbf1ef29f1 Zhu Lingshan 2020-05-26Â 349Â }
Will fix.
Thanks