diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-01-25 23:54:22 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-01-25 23:54:22 +0000 |
commit | c3389e1b3f69813bbcd8cf42d67e1abd769b9c54 (patch) | |
tree | e47eae68a27906a63986b295f4d757f7cf068096 | |
parent | 8ae845db2e2a573eeed71f3350d727d3803ae580 (diff) |
Wow, this is clearly wrong (found in esa_set_params):
if (p->channels < 1 && p->channels > 2)
return EINVAL;
Change the 'and' to an 'or' so the check actually does something.
From jmcneill NetBSD
ok krw@
-rw-r--r-- | sys/dev/pci/esa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index b7bdc550c1e..808644ae7a8 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esa.c,v 1.10 2005/11/21 18:16:41 millert Exp $ */ +/* $OpenBSD: esa.c,v 1.11 2006/01/25 23:54:21 brad Exp $ */ /* $NetBSD: esa.c,v 1.12 2002/03/24 14:17:35 jmcneill Exp $ */ /* @@ -278,7 +278,7 @@ esa_set_params(void *hdl, int setmode, int usemode, struct audio_params *play, if (p->sample_rate < ESA_MINRATE || p->sample_rate > ESA_MAXRATE || (p->precision != 8 && p->precision != 16) || - (p->channels < 1 && p->channels > 2)) + (p->channels < 1 || p->channels > 2)) return (EINVAL); p->factor = 1; |