git: 75e7709f4f3c - main - uvscom: Fix baud rate validation in uvscom_pre_param()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Apr 2026 06:06:27 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=75e7709f4f3c9e1576af45715730c286c1ec3b24
commit 75e7709f4f3c9e1576af45715730c286c1ec3b24
Author: Weixie Cui <cuiweixie@gmail.com>
AuthorDate: 2026-03-31 10:17:28 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-04-16 06:05:20 +0000
uvscom: Fix baud rate validation in uvscom_pre_param()
The switch fell through from the supported B150–B115200 cases into default
and returned EINVAL for every speed. Break out before default so valid
rates return success, matching uvscom_cfg_param().
Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Reviewed by: imp,aokblast
Pull Request: https://github.com/freebsd/freebsd-src/pull/2110
---
sys/dev/usb/serial/uvscom.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/dev/usb/serial/uvscom.c b/sys/dev/usb/serial/uvscom.c
index b9add5c1b37b..c5086f7e86cf 100644
--- a/sys/dev/usb/serial/uvscom.c
+++ b/sys/dev/usb/serial/uvscom.c
@@ -551,8 +551,9 @@ uvscom_pre_param(struct ucom_softc *ucom, struct termios *t)
case B38400:
case B57600:
case B115200:
+ break;
default:
- return (EINVAL);
+ return (EINVAL);
}
return (0);
}