summaryrefslogtreecommitdiff
path: root/sound/oss/dmabuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss/dmabuf.c')
-rw-r--r--sound/oss/dmabuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c
index eaf69971bf92..1e90d769b62e 100644
--- a/sound/oss/dmabuf.c
+++ b/sound/oss/dmabuf.c
@@ -795,9 +795,9 @@ static int find_output_space(int dev, char **buf, int *size)
#ifdef BE_CONSERVATIVE
active_offs = dmap->byte_counter + dmap->qhead * dmap->fragment_size;
#else
- active_offs = DMAbuf_get_buffer_pointer(dev, dmap, DMODE_OUTPUT);
+ active_offs = max(DMAbuf_get_buffer_pointer(dev, dmap, DMODE_OUTPUT), 0);
/* Check for pointer wrapping situation */
- if (active_offs < 0 || active_offs >= dmap->bytes_in_use)
+ if (active_offs >= dmap->bytes_in_use)
active_offs = 0;
active_offs += dmap->byte_counter;
#endif