[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5hr2jhxrrn.wl-tiwai@suse.de>
Date: Thu, 02 Aug 2018 07:27:08 +0200
From: Takashi Iwai <tiwai@...e.de>
To: "Wei Yongjun" <weiyongjun1@...wei.com>
Cc: "Jorge Sanjuan" <jorge.sanjuan@...ethink.co.uk>,
"Michael Drake" <michael.drake@...ethink.co.uk>,
"Ruslan Bilovol" <ruslan.bilovol@...il.com>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Jaroslav Kysela" <perex@...ex.cz>,
"MarkusElfring" <elfring@...rs.sourceforge.net>,
<alsa-devel@...a-project.org>, <kernel-janitors@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes()
On Thu, 02 Aug 2018 06:31:02 +0200,
Wei Yongjun wrote:
>
> sizeof() when applied to a pointer typed expression gives the
> size of the pointer, not that of the pointed data.
>
> Fixes: 7edf3b5e6a45 ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
Applied, thanks.
Takashi
> ---
> sound/usb/stream.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/usb/stream.c b/sound/usb/stream.c
> index 8fe3b0e..67cf849 100644
> --- a/sound/usb/stream.c
> +++ b/sound/usb/stream.c
> @@ -1037,7 +1037,7 @@ static int parse_uac_endpoint_attributes(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);
>
>
Powered by blists - more mailing lists