From e03e77ba4d0570511fdc1be192459e1160c650a6 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 27 Dec 2023 10:09:24 -0800 Subject: [PATCH] ctl: Always return errno values from ctl_port_register Return EBUSY instead of a bare 1 if a port number is already active. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D42929 --- sys/cam/ctl/ctl_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl_frontend.c b/sys/cam/ctl/ctl_frontend.c index ac41a882db6b..1e4d130950c4 100644 --- a/sys/cam/ctl/ctl_frontend.c +++ b/sys/cam/ctl/ctl_frontend.c @@ -162,7 +162,7 @@ ctl_port_register(struct ctl_port *port) if ((port_num < 0) || (ctl_set_mask(softc->ctl_port_mask, port_num) < 0)) { mtx_unlock(&softc->ctl_lock); - return (1); + return (EBUSY); } softc->num_ports++; mtx_unlock(&softc->ctl_lock);