From: William Light <alsa-dev@wrl.illest.net>
To: alsa-devel@alsa-project.org
Cc: William Light <wrl@illest.net>
Subject: [PATCH 1/2] ALSA: snd-usb-caiaq: Fix NULL dereference in input.c
Date: Mon, 10 Oct 2011 15:54:22 +0000 [thread overview]
Message-ID: <1318262063-19247-2-git-send-email-alsa-dev@wrl.illest.net> (raw)
In-Reply-To: <1318262063-19247-1-git-send-email-alsa-dev@wrl.illest.net>
From: William Light <wrl@illest.net>
There was a case where a newly-registered input device could be opened before
a necessary variable in the device structure was set. When code tried to use
the variable in the URB reply callback, it would cause an Oops.
This fix sets the aforementioned variable before calling input_register_device.
Signed-off-by: William Light <wrl@illest.net>
---
sound/usb/caiaq/input.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/sound/usb/caiaq/input.c b/sound/usb/caiaq/input.c
index a213813..9efb92e 100644
--- a/sound/usb/caiaq/input.c
+++ b/sound/usb/caiaq/input.c
@@ -664,15 +664,17 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *dev)
for (i = 0; i < input->keycodemax; i++)
__set_bit(dev->keycode[i], input->keybit);
+ dev->input_dev = input;
+
ret = input_register_device(input);
if (ret < 0)
goto exit_free_idev;
- dev->input_dev = input;
return 0;
exit_free_idev:
input_free_device(input);
+ dev->input_dev = NULL;
return ret;
}
--
1.7.6.1
next prev parent reply other threads:[~2011-10-10 15:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 15:54 [PATCH 0/2] snd-usb-caiaq: Initial Work on NI Maschine Support William Light
2011-10-10 15:54 ` William Light [this message]
2011-10-10 15:54 ` [PATCH 2/2] ALSA: snd-usb-caiaq: Add support for Maschine William Light
2011-10-13 6:26 ` [PATCH 0/2] snd-usb-caiaq: Initial Work on NI Maschine Support Takashi Iwai
2011-10-17 17:56 ` Daniel Mack
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=1318262063-19247-2-git-send-email-alsa-dev@wrl.illest.net \
--to=alsa-dev@wrl.illest.net \
--cc=alsa-devel@alsa-project.org \
--cc=wrl@illest.net \
/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).