linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Defang Bo <bodefang@126.com>
To: perex@perex.cz, tiwai@suse.com
Cc: tom.ty89@gmail.com, kai.heng.feng@canonical.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Defang Bo <bodefang@126.com>
Subject: [PATCH] ALSA:usb-audio:check urb before kill it
Date: Sun, 27 Dec 2020 21:04:59 +0800	[thread overview]
Message-ID: <1609074299-3990670-1-git-send-email-bodefang@126.com> (raw)

Similar to commit<124751d5e>, there should be a check for urb before kill it.

Signed-off-by: Defang Bo <bodefang@126.com>
---
 sound/usb/mixer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 81e987e..0223ef3 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -3589,8 +3589,10 @@ void snd_usb_mixer_disconnect(struct usb_mixer_interface *mixer)
 /* stop any bus activity of a mixer */
 static void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer)
 {
-	usb_kill_urb(mixer->urb);
-	usb_kill_urb(mixer->rc_urb);
+	if (mixer->urb)
+		usb_kill_urb(mixer->urb);
+	if (mixer->rc_urb)
+		usb_kill_urb(mixer->rc_urb);
 }
 
 static int snd_usb_mixer_activate(struct usb_mixer_interface *mixer)
-- 
2.7.4


             reply	other threads:[~2020-12-27 16:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27 13:04 Defang Bo [this message]
2020-12-29  8:25 ` [PATCH] ALSA:usb-audio:check urb before kill it Takashi Iwai

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=1609074299-3990670-1-git-send-email-bodefang@126.com \
    --to=bodefang@126.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=tom.ty89@gmail.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;
as well as URLs for NNTP newsgroup(s).