From: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
To: vinod.koul@linux.intel.com
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
ckeepax@opensource.wolfsonmicro.com,
pierre-louis.bossart@linux.intel.com
Subject: [TINYCOMPRESS][PATCH 1/1] compress: fix hpointer error when no sample rate
Date: Thu, 2 May 2013 14:58:53 +0100 [thread overview]
Message-ID: <20130502135853.GA2744@opensource.wolfsonmicro.com> (raw)
Fixes the oops() in compress_get_hpointer() to return
-ENODATA instead of errno if the sample rate is zero.
The value in errno here is not related to the reason
we are returning an error.
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
---
compress.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/compress.c b/compress.c
index e80e598..abd0799 100644
--- a/compress.c
+++ b/compress.c
@@ -315,7 +315,7 @@ int compress_get_hpointer(struct compress *compress,
if (ioctl(compress->fd, SNDRV_COMPRESS_AVAIL, &kavail))
return oops(compress, errno, "cannot get avail");
if (0 == kavail.tstamp.sampling_rate)
- return oops(compress, errno, "invalid paramter");
+ return oops(compress, -ENODATA, "sample rate unknown");
*avail = (unsigned int)kavail.avail;
time = kavail.tstamp.pcm_io_frames / kavail.tstamp.sampling_rate;
tstamp->tv_sec = time;
--
1.7.2.5
next reply other threads:[~2013-05-02 14:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 13:58 Richard Fitzgerald [this message]
2013-05-23 2:28 ` [TINYCOMPRESS][PATCH 1/1] compress: fix hpointer error when no sample rate Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130502135853.GA2744@opensource.wolfsonmicro.com \
--to=rf@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=vinod.koul@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox