* [PATCH -next] ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes()
@ 2018-08-02 4:31 Wei Yongjun
2018-08-02 5:27 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2018-08-02 4:31 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, Markus Elfring, Ruslan Bilovol,
Jorge Sanjuan, Michael Drake, Greg Kroah-Hartman
Cc: Wei Yongjun, alsa-devel, linux-kernel, kernel-janitors
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@huawei.com>
---
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);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH -next] ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes()
2018-08-02 4:31 [PATCH -next] ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes() Wei Yongjun
@ 2018-08-02 5:27 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2018-08-02 5:27 UTC (permalink / raw)
To: Wei Yongjun
Cc: Jorge Sanjuan, Michael Drake, Ruslan Bilovol, Greg Kroah-Hartman,
Jaroslav Kysela, MarkusElfring, alsa-devel, kernel-janitors,
linux-kernel
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@huawei.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);
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-02 5:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-02 4:31 [PATCH -next] ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes() Wei Yongjun
2018-08-02 5:27 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®