mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Wei Yongjun" <weiyongjun1@huawei.com>
Cc: "Jorge Sanjuan" <jorge.sanjuan@codethink.co.uk>,
	"Michael Drake" <michael.drake@codethink.co.uk>,
	"Ruslan Bilovol" <ruslan.bilovol@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"MarkusElfring" <elfring@users.sourceforge.net>,
	<alsa-devel@alsa-project.org>, <kernel-janitors@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] ALSA: usb-audio: Fix invalid use of sizeof in parse_uac_endpoint_attributes()
Date: Thu, 02 Aug 2018 07:27:08 +0200	[thread overview]
Message-ID: <s5hr2jhxrrn.wl-tiwai@suse.de> (raw)
In-Reply-To: <1533184262-148619-1-git-send-email-weiyongjun1@huawei.com>

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);
> 
> 

      reply	other threads:[~2018-08-02  5:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02  4:31 Wei Yongjun
2018-08-02  5:27 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hr2jhxrrn.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=elfring@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jorge.sanjuan@codethink.co.uk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.drake@codethink.co.uk \
    --cc=perex@perex.cz \
    --cc=ruslan.bilovol@gmail.com \
    --cc=weiyongjun1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®