git: dae615bae5f5 - stable/13 - bhyve: Initialize the return value in blockif_register_resize_callback()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 17 Oct 2022 15:42:12 UTC
The branch stable/13 has been updated by markj:

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

commit dae615bae5f5cc794e65c21ed8647b0ce28d0c15
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-10-08 15:26:38 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-10-17 15:41:24 +0000

    bhyve: Initialize the return value in blockif_register_resize_callback()
    
    (cherry picked from commit 5b966d7871aa14fd6c7656a9be16af3f23c6e17d)
---
 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 89964969c1ee..8f1ae73a0e88 100644
--- a/usr.sbin/bhyve/block_if.c
+++ b/usr.sbin/bhyve/block_if.c
@@ -684,6 +684,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;