From c4f1957e14444e444b35418e85069b7ab65465a5 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 28 Aug 2018 11:46:34 +0300 Subject: ALSA: seq: add error check in snd_seq_system_client_init() Static checkers complain that snd_seq_create_kernel_client() can return -EBUSY here so we need to have some error handling. Signed-off-by: Dan Carpenter Signed-off-by: Takashi Iwai --- sound/core/seq/seq_system.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/core/seq/seq_system.c') diff --git a/sound/core/seq/seq_system.c b/sound/core/seq/seq_system.c index 8ce1d0b40dce..3b89b0adad6a 100644 --- a/sound/core/seq/seq_system.c +++ b/sound/core/seq/seq_system.c @@ -134,6 +134,10 @@ int __init snd_seq_system_client_init(void) /* register client */ sysclient = snd_seq_create_kernel_client(NULL, 0, "System"); + if (sysclient < 0) { + kfree(port); + return sysclient; + } /* register timer */ strcpy(port->name, "Timer"); -- cgit v1.2.1