public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sound: fix check for return value in snd_pcm_hw_refine
@ 2009-06-21 18:26 Mariusz Kozlowski
  2009-06-22  5:56 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Mariusz Kozlowski @ 2009-06-21 18:26 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Takashi Iwai, linux-kernel

Hello,

'params' is a pointer and looking at the code this probably should be a check
for ioctl return value.

	Mariusz


Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 84da3ba..ac2150e 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -320,7 +320,7 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
                     snd_mask_max(&params->masks[SNDRV_PCM_HW_PARAM_CHANNELS])) {
 			changed = substream->ops->ioctl(substream,
 					SNDRV_PCM_IOCTL1_FIFO_SIZE, params);
-			if (params < 0)
+			if (changed < 0)
 				return changed;
 		}
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sound: fix check for return value in snd_pcm_hw_refine
  2009-06-21 18:26 [PATCH] sound: fix check for return value in snd_pcm_hw_refine Mariusz Kozlowski
@ 2009-06-22  5:56 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2009-06-22  5:56 UTC (permalink / raw)
  To: Mariusz Kozlowski; +Cc: Jaroslav Kysela, linux-kernel

At Sun, 21 Jun 2009 20:26:59 +0200,
Mariusz Kozlowski wrote:
> 
> Hello,
> 
> 'params' is a pointer and looking at the code this probably should be a check
> for ioctl return value.
> 
> 	Mariusz
> 
> 
> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>

Applied now.  Thanks!


Takashi

> 
> diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> index 84da3ba..ac2150e 100644
> --- a/sound/core/pcm_native.c
> +++ b/sound/core/pcm_native.c
> @@ -320,7 +320,7 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
>                      snd_mask_max(&params->masks[SNDRV_PCM_HW_PARAM_CHANNELS])) {
>  			changed = substream->ops->ioctl(substream,
>  					SNDRV_PCM_IOCTL1_FIFO_SIZE, params);
> -			if (params < 0)
> +			if (changed < 0)
>  				return changed;
>  		}
>  	}
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-22  5:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-21 18:26 [PATCH] sound: fix check for return value in snd_pcm_hw_refine Mariusz Kozlowski
2009-06-22  5:56 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox