lkml.org 
[lkml]   [2018]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sound: line6: fix a missing check of snd_card_register
Date
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@umn.edu>
---
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)
\
 
 \ /
  Last update: 2018-12-26 04:33    [W:0.030 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site