linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Xu Wang <vulab@iscas.ac.cn>
Cc: perex@perex.cz, tiwai@suse.com, alexander@tsoy.me,
	e.burema@gmail.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: usb-audio: endpoint : remove redundant check before usb_free_coherent()
Date: Thu, 04 Feb 2021 07:40:35 +0100	[thread overview]
Message-ID: <s5him788hek.wl-tiwai@suse.de> (raw)
In-Reply-To: <20210204020518.76619-1-vulab@iscas.ac.cn>

On Thu, 04 Feb 2021 03:05:18 +0100,
Xu Wang wrote:
> 
> usb_free_coherent() is safe with NULL addr and this check is
> not required.

The check there isn't about NULL buffer or not; instead it checks
whether the buffer was allocated for each or it shares the single
buffer (for sync endpoints).  In the latter case, your patch will lead
to double-free.


thanks,

Takashi

      reply	other threads:[~2021-02-04  6:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  2:05 [PATCH] ALSA: usb-audio: endpoint : remove redundant check before usb_free_coherent() Xu Wang
2021-02-04  6:40 ` 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=s5him788hek.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alexander@tsoy.me \
    --cc=alsa-devel@alsa-project.org \
    --cc=e.burema@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=vulab@iscas.ac.cn \
    /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;
as well as URLs for NNTP newsgroup(s).