* [PATCH] ALSA: usb-audio: Fix wrong sizeof argument
@ 2018-08-02 14:17 Gustavo A. R. Silva
2018-08-02 14:20 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-02 14:17 UTC (permalink / raw)
To: Jorge Sanjuan, Jaroslav Kysela, Takashi Iwai
Cc: alsa-devel, linux-kernel, Gustavo A. R. Silva
The correct argument to be passed to kzalloc is sizeof(*pd)
Addresses-Coverity-ID: 1472224 ("Wrong sizeof argument")
Fixes: 7edf3b5e6a45 ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.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 @@ 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);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: usb-audio: Fix wrong sizeof argument
2018-08-02 14:17 [PATCH] ALSA: usb-audio: Fix wrong sizeof argument Gustavo A. R. Silva
@ 2018-08-02 14:20 ` Takashi Iwai
2018-08-02 19:54 ` Gustavo A. R. Silva
0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2018-08-02 14:20 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Jorge Sanjuan, Jaroslav Kysela, alsa-devel, linux-kernel
On Thu, 02 Aug 2018 16:17:23 +0200,
Gustavo A. R. Silva wrote:
>
> The correct argument to be passed to kzalloc is sizeof(*pd)
>
> Addresses-Coverity-ID: 1472224 ("Wrong sizeof argument")
> Fixes: 7edf3b5e6a45 ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
It's already fixed, thanks.
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: usb-audio: Fix wrong sizeof argument
2018-08-02 14:20 ` Takashi Iwai
@ 2018-08-02 19:54 ` Gustavo A. R. Silva
0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-02 19:54 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Jorge Sanjuan, Jaroslav Kysela, alsa-devel, linux-kernel
On 08/02/2018 09:20 AM, Takashi Iwai wrote:
> On Thu, 02 Aug 2018 16:17:23 +0200,
> Gustavo A. R. Silva wrote:
>>
>> The correct argument to be passed to kzalloc is sizeof(*pd)
>>
>> Addresses-Coverity-ID: 1472224 ("Wrong sizeof argument")
>> Fixes: 7edf3b5e6a45 ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> It's already fixed, thanks.
>
Good to know. :)
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-02 19:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-02 14:17 [PATCH] ALSA: usb-audio: Fix wrong sizeof argument Gustavo A. R. Silva
2018-08-02 14:20 ` Takashi Iwai
2018-08-02 19:54 ` Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).