git: e6bb702fce3f - stable/13 - bhyve: return EEXIST when adding a fwcfg item twice

From: Corvin Köhne <corvink_at_FreeBSD.org>
Date: Thu, 06 Apr 2023 06:09:55 UTC
The branch stable/13 has been updated by corvink:

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

commit e6bb702fce3feb41a0f30ac9c09e30b70ad850c2
Author:     Corvin Köhne <corvink@FreeBSD.org>
AuthorDate: 2023-03-30 05:43:28 +0000
Commit:     Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2023-04-06 06:06:23 +0000

    bhyve: return EEXIST when adding a fwcfg item twice
    
    Reviewed by:            rew
    MFC after:              1 week
    Sponsored by:           Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D39338
    
    (cherry picked from commit e37edc91b6a0a0116005bdd0fff7c911c37adabf)
---
 usr.sbin/bhyve/qemu_fwcfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c
index 1b0b5e3e9931..bb86d0371985 100644
--- a/usr.sbin/bhyve/qemu_fwcfg.c
+++ b/usr.sbin/bhyve/qemu_fwcfg.c
@@ -178,7 +178,7 @@ qemu_fwcfg_add_item(const uint16_t architecture, const uint16_t index,
 	if (fwcfg_item->data != NULL) {
 		warnx("%s: qemu fwcfg item exists (architecture %s index 0x%x)",
 		    __func__, arch ? "specific" : "generic", idx);
-		return (-1);
+		return (EEXIST);
 	}
 
 	/* save data of the item */