diff options
Diffstat (limited to 'sound/core/sound.c')
-rw-r--r-- | sound/core/sound.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c index 8dc7a3b32b98..f6ebce08b537 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -266,6 +266,14 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev, snd_minors[minor] = preg; preg->dev = device_create(sound_class, device, MKDEV(major, minor), "%s", name); + if (IS_ERR(preg->dev)) { + snd_minors[minor] = NULL; + mutex_unlock(&sound_mutex); + minor = PTR_ERR(preg->dev); + kfree(preg); + return minor; + } + if (preg->dev) dev_set_drvdata(preg->dev, private_data); |