Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Apr 2026 06:06:27 +0000
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Cc:        Weixie Cui <cuiweixie@gmail.com>
Subject:   git: 75e7709f4f3c - main - uvscom: Fix baud rate validation in uvscom_pre_param()
Message-ID:  <69e07c63.3d3b3.6ef3e991@gitrepo.freebsd.org>

index | next in thread | raw e-mail

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);
 }


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e07c63.3d3b3.6ef3e991>