You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Takashi Iwai
parent
5cf92c8b3d
commit
cb68429d15
+1
-1
@@ -655,7 +655,7 @@ static void cleanup_oss_soundcore(void)
|
|||||||
static int __init init_oss_soundcore(void)
|
static int __init init_oss_soundcore(void)
|
||||||
{
|
{
|
||||||
if (preclaim_oss &&
|
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");
|
printk(KERN_ERR "soundcore: sound device already in use.\n");
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user