浏览代码

ALSA: sb8 - Fix a return code in the error path

Fixed a compile warning below:
  sound/isa/sb/sb8.c: In function ‘snd_sb8_probe’:
  sound/isa/sb/sb8.c:104: warning: ‘err’ may be used uninitialized in this function
by setting the return value correctly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 16 年之前
父节点
当前提交
42a73df435
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      sound/isa/sb/sb8.c

+ 3 - 1
sound/isa/sb/sb8.c

@@ -140,8 +140,10 @@ static int __devinit snd_sb8_probe(struct device *pdev, unsigned int dev)
 				break;
 			}
 		}
-		if (i >= ARRAY_SIZE(possible_ports))
+		if (i >= ARRAY_SIZE(possible_ports)) {
+			err = -EINVAL;
 			goto _err;
+		}
 	}
 	acard->chip = chip;