summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2015-11-07 01:56:05 +0300
committerTakashi Iwai <tiwai@suse.de>2015-11-07 11:14:30 +0100
commitcb68429d155507ec46f1922d2beb7bc637de4836 (patch)
tree906caa97e530348ca4edcf0efb3a3606327695c8 /sound
parent5cf92c8b3dc5da59e05dc81bdc069cedf6f38313 (diff)
sound: fix check for error condition of register_chrdev()
init_oss_soundcore() compares returned value of register_chrdev() with -1, while other error codes can be returned. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/sound_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 11e953a1fa45..99b73c675743 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -655,7 +655,7 @@ static void cleanup_oss_soundcore(void)
static int __init init_oss_soundcore(void)
{
if (preclaim_oss &&
- register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops) == -1) {
+ register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops) < 0) {
printk(KERN_ERR "soundcore: sound device already in use.\n");
return -EBUSY;
}