[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1446850565-8451-1-git-send-email-khoroshilov@ispras.ru>
Date: Sat, 7 Nov 2015 01:56:05 +0300
From: Alexey Khoroshilov <khoroshilov@...ras.ru>
To: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc: Alexey Khoroshilov <khoroshilov@...ras.ru>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
ldv-project@...uxtesting.org
Subject: [PATCH] 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@...ras.ru>
---
sound/sound_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists