Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11175556 authored by Wei Yongjun's avatar Wei Yongjun Committed by Takashi Iwai
Browse files

ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes()



sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Fixes: 7edf3b5e ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 93ce1b12
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1037,7 +1037,7 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip,
		fp->rate_max = UAC3_BADD_SAMPLING_RATE;
		fp->rates = SNDRV_PCM_RATE_CONTINUOUS;

		pd = kzalloc(sizeof(pd), GFP_KERNEL);
		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
		if (!pd) {
			kfree(fp->rate_table);
			kfree(fp);