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: 10486771 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 EDE1F6023A for ; Mon, 25 Jun 2018 15:32:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBD5628585 for ; Mon, 25 Jun 2018 15:32:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D03E6285A4; Mon, 25 Jun 2018 15:32:12 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D25928585 for ; Mon, 25 Jun 2018 15:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Qhg2LJ1pNTlMoDESRRS5ONlc/oKAlI0I4lG6UboN3DI=; b=EPmnaDVfqTKQVRJuLy/a7o4k+9 H2EyBJhJ9Obd2TRaw0d/Mhtopo+qHXNuyed7sZrtDmBg9yY6CoG0RTGMc0FjsDG96daDq8CLC/yDM htpZhdDr+eAwmzpsZMngNz+T+ah0VzgC/sTno7nEC1bhetYeym79Zk7Dm7S3c94SpSz4dBsl4lx+v AjdqWsjBWur5klxTv6ch8L57ZL3lfbeCbl81mN7ErmTCCEG8b8X/fTqcxtSrHQwThgMAQbKt+/LmB N8izdGuab/3XeWuhz3cCFBkXlXnl1oRXsT+3KDzVF/V7tnvUM5D1Mx8ov+tldlgKYKG6McBiI+uRA lIz/WBTw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXTTF-0002Oi-Bt; Mon, 25 Jun 2018 15:32:01 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXSZG-0003Ze-KA for linux-arm-kernel@lists.infradead.org; Mon, 25 Jun 2018 14:34:14 +0000 Received: by mail-wm0-x234.google.com with SMTP id u18-v6so5804815wmc.1 for ; Mon, 25 Jun 2018 07:34:00 -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=sBlAIjAvQF9Hausi7sUDE/k8JUhzW7BIItRB1Uas6hJla024LQZ+NfRu6rWCSvjO4h BhGSrVal9AnuU3jOPJCRzP0Ul2g/MdpRA8SsMMSZ6RnqEk/zGrq9zvVwbyUbHCm5tkuC 2zBO1z0bd8DKBUfiWuoUC5r8e+CN269J00KWymir5W9v8c6j1eKzspADfBfYtPZiSKUZ /SGscMNDiV6pg+FM2JdLIULbOMKK/J9XzuK9zDwboYC8EJ38eMSc+qRA0YATM/9No14l R7lbr0tcr5FSkGFF5BqdTPKVepQUxcuSc0DvTjpXTCAEIFjGWYUQ0pnrfdQwPYR7nY+v inbA== X-Gm-Message-State: APt69E0zE1kyStpjn0bhyqABdod4tmckRqIYBGm1poOc/L882WkgAk7i Z5VjED1EHhl703bT5ozdMpqUfw== 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 Subject: [PATCH 11/11] ASoC: qdsp6: q6routing: add proper error check 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180625_073410_684604_2F3139F1 X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rohkumar@qti.qualcomm.com, devicetree@vger.kernel.org, plai@codeaurora.org, tiwai@suse.com, lgirdwood@gmail.com, perex@perex.cz, srinivas.kandagatla@linaro.org, niklas.cassel@linaro.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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; }