Skip to contentSkip to conversation

ALSA: rawmidi - fix the uninitalized user_pversion

PATCH Applied Jaroslav Kysela 2 participants 2 messages Dec 18, 2021 – Dec 22, 2021 Sound

lore
Share & tools
lore

Jaroslav Kysela

author maintainer
#0 lore raw

PATCH 1/1 ALSA: rawmidi - fix the uninitalized user_pversion

The user_pversion was unitialized for the user space file structure in the open function, because the file private structure use kmalloc for the allocation.

The kernel ALSA sequencer code clears the file structure, so no additional fixes are required.

Fixes 09d23174402d ("ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION")
Reported-by [email protected]
---
 sound/core/rawmidi.c | 1 +
 1 file changed, 1 insertion(+)
sound/core/rawmidi.c +1 -0
index 6f30231bdb88..befa9809ff00 100644
@@ -447,6 +447,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
 		err = -ENOMEM;
 		goto __error;
 	}
+	rawmidi_file->user_pversion = 0;
 	init_waitqueue_entry(&wait, current);
 	add_wait_queue(&rmidi->open_wait, &wait);
 	while (1) {
Signature · 1 line
2.31.1
Applied
#1 lore raw
Quoted 8 lines · Jaroslav Kysela

The user_pversion was unitialized for the user space file structure in the open function, because the file private structure use kmalloc for the allocation.

The kernel ALSA sequencer code clears the file structure, so no additional fixes are required.

Quoted 6 lines
Fixes 09d23174402d ("ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION")
Reported-by [email protected]

Thanks, applied now with a minor typo fix.

Takashi