Skip to contentSkip to conversation

sound: fix check for return value in snd_pcm_hw_refine

PATCH In review Mariusz Kozlowski 2 participants 2 messages Jun 21, 2009 – Jun 22, 2009 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound: fix check for return value in snd_pcm_hw_refine

Hello,

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

Mariusz

sound/core/pcm_native.c +1 -1
index 84da3ba..ac2150e 100644
@@ -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;
 		}
 	}
#1 lore raw

At Sun, 21 Jun 2009 20:26:59 +0200,

Quoted 10 lines · Mariusz Kozlowski

Hello,

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

Mariusz

Applied now. Thanks!

Takashi

Quoted 15 lines
sound/core/pcm_native.c +1 -1
index 84da3ba..ac2150e 100644
@@ -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;
 		}
 	}