[PATCH] sound: line6: fix a missing check of snd_card_register

From: Kangjie Lu
Date: Tue Dec 25 2018 - 22:32:44 EST


snd_card_register() may fail, so let's check its status and issue an
error message if it fails.

Signed-off-by: Kangjie Lu <kjlu@xxxxxxx>
---
sound/usb/line6/variax.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/usb/line6/variax.c b/sound/usb/line6/variax.c
index e8c852b2ce35..b0caa9ea1f5f 100644
--- a/sound/usb/line6/variax.c
+++ b/sound/usb/line6/variax.c
@@ -167,7 +167,8 @@ static void variax_startup6(struct work_struct *work)
CHECK_STARTUP_PROGRESS(variax->startup_progress, VARIAX_STARTUP_SETUP);

/* ALSA audio interface: */
- snd_card_register(variax->line6.card);
+ if (snd_card_register(variax->line6.card))
+ dev_err(variax->line6.ifcdev, "Failed to register variax card.\n");
}

/*
--
2.17.2 (Apple Git-113)