Skip to contentSkip to conversation

ALSA: pcm: Fix the previous conversion to kstrtoul()

PATCH In review Takashi Iwai 2 participants 2 messages Sep 1, 2024 – Sep 2, 2024 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: pcm: Fix the previous conversion to kstrtoul()

The previous replacement from simple_strtoul() to kstrtoul() forgot that the passed pointer must be an unsigned long int pointer, while the value used there is a sized_t pointer. Fix it.

Fixes 61bc4deff033 ("ALSA: pcm: replace simple_strtoul to kstrtoul")
---
 sound/core/pcm_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/pcm_memory.c +1 -1
index 73d4fc49a0ca..5001181208df 100644
@@ -183,7 +183,7 @@ static void snd_pcm_lib_preallocate_proc_write(struct snd_info_entry *entry,
 	struct snd_pcm_substream *substream = entry->private_data;
 	struct snd_card *card = substream->pcm->card;
 	char line[64], str[64];
-	size_t size;
+	unsigned long size;
 	struct snd_dma_buffer new_dmab;
 
 	guard(mutex)(&substream->pcm->open_mutex);
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Takashi Iwai

The previous replacement from simple_strtoul() to kstrtoul() forgot that the passed pointer must be an unsigned long int pointer, while the value used there is a sized_t pointer. Fix it.

Fixes 61bc4deff033 ("ALSA: pcm: replace simple_strtoul to kstrtoul")
---
  sound/core/pcm_memory.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/pcm_memory.c +0 -0
index 73d4fc49a0ca..5001181208df 100644

sound/core/pcm_memory.c static void snd_pcm_lib_preallocate_proc_write(struct snd_info_entry *entry, · line 186

Quoted 5 lines
sound/core/pcm_memory.c +1 -1
@@ -183,7 +183,7 @@ static void snd_pcm_lib_preallocate_proc_write(struct snd_info_entry *entry,
  	struct snd_pcm_substream *substream = entry->private_data;
  	struct snd_card *card = substream->pcm->card;
  	char line[64], str[64];
-	size_t size;
+	unsigned long size;

Sorry, I haven't noticed this.

Quoted 3 lines
sound/core/pcm_memory.c +0 -0
  	struct snd_dma_buffer new_dmab;
 
  	guard(mutex)(&substream->pcm->open_mutex);