From patchwork Mon Jun 25 14:31:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10486447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 060D46023A for ; Mon, 25 Jun 2018 14:35:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E06F72847B for ; Mon, 25 Jun 2018 14:35:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4DA3285A8; Mon, 25 Jun 2018 14:35:20 +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 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 38BEB2847B for ; Mon, 25 Jun 2018 14:35:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 25C3D26783D; Mon, 25 Jun 2018 16:34:11 +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 910B526782C; Mon, 25 Jun 2018 16:34:02 +0200 (CEST) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by alsa0.perex.cz (Postfix) with ESMTP id 8C295267822 for ; Mon, 25 Jun 2018 16:33:59 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id i139-v6so2585334wmf.4 for ; Mon, 25 Jun 2018 07:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KWB6NY8t/omvKgNIyRy4P+yYxeMR+uXpqk4adQInmwE=; b=V7TRGhWRzGp/1OxGK8hqABT03Zv9oV2yZclH8iokFjTCT8cUqtaCDPuWT4hzicPMrE 2FEuWdHFc9IpBE17Br3cobZJjppGLJ2s0NuoYK6sdRddph+Eg/3UzgXO5L0yVRsosSgo 0HSyRzHJpppgp1qL0U5ZXIoS2zp9UZpURzGw4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KWB6NY8t/omvKgNIyRy4P+yYxeMR+uXpqk4adQInmwE=; b=hLG3GgzTcEJZysAL6tHc9j/yvs0pq5NSIWEmG5McAcxXDFvu9Adk+2OJNjsOdIblpi PSFgjL8MdXGzm1O2eOgRJ730/Vm1m/d6m2N+DEnwX5MELAX7lvnx6qks3cEVEMNw6Puh 2qMz6ujs2y2aC0k/3B9OED+ys7Ghf869YQZ2MJwFYIXjMCs1Gc0XcSXTsm+j9Vu6ryYR owUN1BDp7ynwqMPAb6IOqsDNyHiS7iJ67JbGOAByGvWpcqjzFrzCH2J56S5IRXALlP3w Zr6EJtmC3qM+o9H8RxcNoCZ8H2WXLfNdSlTo3eAZkeFu7xUvY+4tdeXbxXyY5qjNBhXC DRoA== X-Gm-Message-State: APt69E2U86T2l/A89tq5GtGEdknhQu0V4enb70ubN5Q7VaGmCthg4YXj JB7Xj4E4EUGJVhyydxzLkoeGBg== X-Google-Smtp-Source: AAOMgpdXWKUVst0hchUZFY9nOuUoJXFVnL9Z/qHzkWrR/Fu+cIV9rlEya/zgViw00eFFVAEaRajqLA== X-Received: by 2002:a1c:2c03:: with SMTP id s3-v6mr1227895wms.109.1529937238873; Mon, 25 Jun 2018 07:33:58 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id s12-v6sm1321193wrr.43.2018.06.25.07.33.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Jun 2018 07:33:58 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, robh+dt@kernel.org, bgoswami@codeaurora.org Date: Mon, 25 Jun 2018 15:31:15 +0100 Message-Id: <20180625143115.8346-12-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180625143115.8346-1-srinivas.kandagatla@linaro.org> References: <20180625143115.8346-1-srinivas.kandagatla@linaro.org> Cc: rohkumar@qti.qualcomm.com, devicetree@vger.kernel.org, plai@codeaurora.org, tiwai@suse.com, lgirdwood@gmail.com, srinivas.kandagatla@linaro.org, niklas.cassel@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 11/11] ASoC: qdsp6: q6routing: add proper error check 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP q6adm_open can return error pointer or a null in error cases. Fix this check this. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6routing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index caf2f847a886..c18f808c7730 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -310,7 +310,7 @@ int q6routing_stream_open(int fedai_id, int perf_mode, session->channels, topology, perf_mode, session->bits_per_sample, 0, 0); - if (!copp) { + if (IS_ERR_OR_NULL(copp)) { mutex_unlock(&routing_data->lock); return -EINVAL; }