Browse Source

ALSA: virmidi: Fix wrong error check

While rewriting the code in the previous commit [316638a5030a: ALSA:
virmidi: fixed code style issues], the error check was wrongly
converted.  This resulted an Oops.

Fixes: 316638a5030a ('ALSA: virmidi: fixed code style issues')
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 10 năm trước cách đây
mục cha
commit
fc5d3c70f9
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      sound/drivers/virmidi.c

+ 1 - 1
sound/drivers/virmidi.c

@@ -121,7 +121,7 @@ static int snd_virmidi_probe(struct platform_device *devptr)
 	sprintf(card->longname, "Virtual MIDI Card %i", dev + 1);
 
 	err = snd_card_register(card);
-	if (err) {
+	if (!err) {
 		platform_set_drvdata(devptr, card);
 		return 0;
 	}