mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
sound(4): Fix memory map of /dev/dsp devices when buffer size is not a multiple of PAGE_SIZE.
By using sndbuf_getallocsize() instead of sndbuf_getsize() in dsp_mmap_single(). PR: 267555 MFC after: 1 week Sponsored by: NVIDIA Networking
This commit is contained in:
parent
eb4d86d529
commit
ad370f7658
|
@ -2291,7 +2291,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset,
|
|||
|
||||
c = ((nprot & PROT_WRITE) != 0) ? wrch : rdch;
|
||||
if (c == NULL || (c->flags & CHN_F_MMAP_INVALID) ||
|
||||
(*offset + size) > sndbuf_getsize(c->bufsoft) ||
|
||||
(*offset + size) > sndbuf_getallocsize(c->bufsoft) ||
|
||||
(wrch != NULL && (wrch->flags & CHN_F_MMAP_INVALID)) ||
|
||||
(rdch != NULL && (rdch->flags & CHN_F_MMAP_INVALID))) {
|
||||
relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR);
|
||||
|
|
Loading…
Reference in a new issue