sound: mmap returns page number, not byte offset
authorSimon Schubert <corecode@dragonflybsd.org>
Tue, 8 Sep 2009 11:58:28 +0000 (13:58 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Tue, 8 Sep 2009 11:58:28 +0000 (13:58 +0200)
Noticed-by: hasso@
sys/dev/sound/pcm/dsp.c

index b9a6cec..48fdd42 100644 (file)
@@ -1151,7 +1151,7 @@ dsp_mmap(struct dev_mmap_args *ap)
        if (!(c->flags & CHN_F_MAPPED))
                c->flags |= CHN_F_MAPPED;
 
-       ap->a_result = vtophys(sndbuf_getbufofs(c->bufsoft, offset));
+       ap->a_result = atop(vtophys(sndbuf_getbufofs(c->bufsoft, offset)));
        relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR);
 
        return (0);