git: e03e77ba4d05 - main - ctl: Always return errno values from ctl_port_register
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 27 Dec 2023 18:11:35 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=e03e77ba4d0570511fdc1be192459e1160c650a6
commit e03e77ba4d0570511fdc1be192459e1160c650a6
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-12-27 18:09:24 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-12-27 18:09:24 +0000
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);