git: 5b966d7871aa - main - bhyve: Initialize the return value in blockif_register_resize_callback()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Sat, 08 Oct 2022 15:33:55 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=5b966d7871aa14fd6c7656a9be16af3f23c6e17d

commit 5b966d7871aa14fd6c7656a9be16af3f23c6e17d
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-10-08 15:26:38 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-10-08 15:33:43 +0000

    bhyve: Initialize the return value in blockif_register_resize_callback()
    
    MFC after:      1 week
---
 usr.sbin/bhyve/block_if.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usr.sbin/bhyve/block_if.c b/usr.sbin/bhyve/block_if.c
index 52f6d92f11ee..84877927b53e 100644
--- a/usr.sbin/bhyve/block_if.c
+++ b/usr.sbin/bhyve/block_if.c
@@ -694,6 +694,8 @@ blockif_register_resize_callback(struct blockif_ctxt *bc, blockif_resize_cb *cb,
 	if (cb == NULL)
 		return (EINVAL);
 
+	err = 0;
+
 	pthread_mutex_lock(&bc->bc_mtx);
 	if (bc->bc_resize_cb != NULL) {
 		err = EBUSY;