From 6e490734fc2ec76e87c8262d7a64dfde126b55dd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 25 Aug 2005 19:51:47 +0200 Subject: [PATCH] --- yaml --- r: 6567 b: refs/heads/master c: 7153a558ad598ff521f1d9430982e2a4a6865126 h: refs/heads/master i: 6565: 3992355869a940fd85c36c688b98382ce4e44bcc 6563: 6d750c2210a7441d2ceb1b1ded455bb5fb618776 6559: 01a9b50fc5479576a34260c9be9bb5c3f5a3a430 v: v3 --- [refs] | 2 +- trunk/sound/core/pcm_compat.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 8bf880b8c191..f54f890d9fb9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e0c93cf311b3eaa04bfb5769cff38861d4e748c8 +refs/heads/master: 7153a558ad598ff521f1d9430982e2a4a6865126 diff --git a/trunk/sound/core/pcm_compat.c b/trunk/sound/core/pcm_compat.c index eef94a15f50a..4b6307df846d 100644 --- a/trunk/sound/core/pcm_compat.c +++ b/trunk/sound/core/pcm_compat.c @@ -144,7 +144,7 @@ static int snd_pcm_ioctl_sw_params_compat(snd_pcm_substream_t *substream, err = snd_pcm_sw_params(substream, ¶ms); if (err < 0) return err; - if (put_user(boundary, &src->boundary)) + if (boundary && put_user(boundary, &src->boundary)) return -EFAULT; return err; } @@ -252,8 +252,11 @@ static int snd_pcm_ioctl_hw_params_compat(snd_pcm_substream_t *substream, goto error; } - if (! refine) - runtime->boundary = recalculate_boundary(runtime); + if (! refine) { + unsigned int new_boundary = recalculate_boundary(runtime); + if (new_boundary) + runtime->boundary = new_boundary; + } error: kfree(data); return err; @@ -408,6 +411,8 @@ static int snd_pcm_ioctl_sync_ptr_compat(snd_pcm_substream_t *substream, status = runtime->status; control = runtime->control; boundary = recalculate_boundary(runtime); + if (! boundary) + boundary = 0x7fffffff; snd_pcm_stream_lock_irq(substream); /* FIXME: we should consider the boundary for the sync from app */ if (!(sflags & SNDRV_PCM_SYNC_PTR_APPL))