summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-06-10 10:59:11 +0200
committerMichael S. Tsirkin <mst@redhat.com>2020-06-22 18:34:21 +0200
commit1c3d69ab5348b661616992206357a3ebf19b1008 (patch)
tree900c474a156fe4c676560d474d53232804b9cbdb
parentvhost_vdpa: Fix potential underflow in vhost_vdpa_mmap() (diff)
downloadlinux-1c3d69ab5348b661616992206357a3ebf19b1008.tar.xz
linux-1c3d69ab5348b661616992206357a3ebf19b1008.zip
virtio-mem: silence a static checker warning
Smatch complains that "rc" can be uninitialized if we hit the "break;" statement on the first iteration through the loop. I suspect that this can't happen in real life, but returning a zero literal is cleaner and silence the static checker warning. Fixes: 5f1f79bbc9e2 ("virtio-mem: Paravirtualized memory hotplug") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20200610085911.GC5439@mwanda Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--drivers/virtio/virtio_mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
index 50c689f25045..5210ff0c5681 100644
--- a/drivers/virtio/virtio_mem.c
+++ b/drivers/virtio/virtio_mem.c
@@ -1192,7 +1192,7 @@ static int virtio_mem_mb_plug_any_sb(struct virtio_mem *vm, unsigned long mb_id,
VIRTIO_MEM_MB_STATE_OFFLINE);
}
- return rc;
+ return 0;
}
/*