From patchwork Tue Aug 28 08:46:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10578061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 145CB14BD for ; Tue, 28 Aug 2018 09:05:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02C40296EF for ; Tue, 28 Aug 2018 09:05:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9C0F296F9; Tue, 28 Aug 2018 09:05:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42B94296EF for ; Tue, 28 Aug 2018 09:05:10 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 92680267741; Tue, 28 Aug 2018 10:46:53 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A27802678A7; Tue, 28 Aug 2018 10:46:50 +0200 (CEST) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by alsa0.perex.cz (Postfix) with ESMTP id C1A572676BD for ; Tue, 28 Aug 2018 10:46:47 +0200 (CEST) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7S8iOAB128582; Tue, 28 Aug 2018 08:46:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=6LE1ASb4tDp+FsAdvc1NSXKX2HpiNriV0qxojyTtPKs=; b=XbBecJFjh65yNhO5mP6J7qtrEK0EVyN1zqs64DJSpDq/wc0TpEHZt0U9LuXd9Nf3DCqs DIF6Fz7FTEVlTZC1i6LFG6h46UXixe9KxT8VzWtrrEBZRqcFzBjeqFBMD8V85Wx2KF01 75NgBDLrxMaSs01xiL888hvGL0Aq5ONVApcVO1gshOZ0THxYH4PfTXP4j/GxXmc4vSGl hzpCFMOy11xEPcr267PnkYaU3/7iqPiGU/1x8Dgk4I5HuHttL0Em6gp5LWow+k4/qVJO RISqwWlDXvKe33mk869F5yitH3Q8oC+xhpwqsotAhIV6dUx3PJBHszdomHkhi3SEDwBV +Q== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2m2xhtjh1v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Aug 2018 08:46:45 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w7S8khsx027664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Aug 2018 08:46:44 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7S8kfao015636; Tue, 28 Aug 2018 08:46:42 GMT Received: from kili.mountain (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 Aug 2018 01:46:41 -0700 Date: Tue, 28 Aug 2018 11:46:34 +0300 From: Dan Carpenter To: Jaroslav Kysela Message-ID: <20180828084634.5tlvwgc6znrqixro@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8998 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808280091 Cc: alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, Takashi Iwai Subject: [alsa-devel] [PATCH] [ALSA] seq: add error check in snd_seq_system_client_init() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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");