Commit 1c3d69ab authored by Dan Carpenter's avatar Dan Carpenter Committed by Michael S. Tsirkin
Browse files

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: 5f1f79bb ("virtio-mem: Paravirtualized memory hotplug")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200610085911.GC5439@mwanda


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent c09cc2c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}

/*