Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Ranostay <mranostay@embeddedalley.com>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>, Dmitry Torokhov <dtor@mail.ru>,
	Mark Brown <broonie@sirena.org.uk>
Subject: [PATCH2/4] hda: dynamic jack id
Date: Sat, 25 Oct 2008 01:05:29 -0400	[thread overview]
Message-ID: <4902A919.6010100@embeddedalley.com> (raw)

This patch duplicates the jack->id pointer with kstrdup() to prevent
scoping issues from calling autoprobing functions from the HDA section.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
---

diff --git a/sound/core/jack.c b/sound/core/jack.c
index 4978db1..284432f 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -34,6 +34,7 @@ static int snd_jack_dev_free(struct snd_device *device)
 	else
 		input_free_device(jack->input_dev);

+	kfree(jack->id);
 	kfree(jack);

 	return 0;
@@ -87,7 +88,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
 	if (jack == NULL)
 		return -ENOMEM;

-	jack->id = id;
+	jack->id = kstrdup(id, GFP_KERNEL);

 	jack->input_dev = input_allocate_device();
 	if (jack->input_dev == NULL) {

             reply	other threads:[~2008-10-25  5:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-25  5:05 Matthew Ranostay [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-10-21 17:26 [PATCH2/4] hda: dynamic jack id Matthew Ranostay
2008-10-21 19:41 ` Mark Brown

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=4902A919.6010100@embeddedalley.com \
    --to=mranostay@embeddedalley.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@sirena.org.uk \
    --cc=dtor@mail.ru \
    --cc=tiwai@suse.de \
    /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