compress: fix hpointer error when no sample rate
PATCH 1/1 compress: fix hpointer error when no sample rate
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 <[email protected]>
--- compress.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
compress.c +1 -1
@@ -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;
Signature · 1 line
1.7.2.5
Quoted 6 lines · Richard Fitzgerald
Fixes the
oops()incompress_get_hpointer()to return-ENODATAinstead 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 <[email protected]>
Applied thanks
--
~Vinod
Quoted 24 lines
--- compress.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)compress.c +1
-1@@ -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;Signature · 6 lines
1.7.2.5 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel