diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2007-10-09 12:34:06 +0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 18:51:06 +0400 |
commit | 2469049e728ee0542d6617f81311a18a14e73826 (patch) | |
tree | 4a6d5f67c89107f01271f3fff28568928e8b29d1 /sound/last.c | |
parent | 1e74190bc0f8a5ab7e83bdf6688fcaebbed25316 (diff) | |
download | linux-2469049e728ee0542d6617f81311a18a14e73826.tar.xz |
[ALSA] sound: snd_register_device_for_dev fix
snd_register_device_for_dev() can oops when device_create() returns
ERR_PTR(err).
Scenario:
preg->dev = device_create(...); /* fails */
if (preg->dev) /* contains ERR_PTR(err) */
dev_set_drvdata(preg->dev, private_data);
and dev_set_drvdata() looks like this:
static inline void
dev_set_drvdata (struct device *dev, void *data)
{
dev->driver_data = data; <--- boom
}
This patch should prevent that.
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/last.c')
0 files changed, 0 insertions, 0 deletions