From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68406C43603 for ; Wed, 4 Dec 2019 20:00:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3AAB92073B for ; Wed, 4 Dec 2019 20:00:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728064AbfLDUA6 (ORCPT ); Wed, 4 Dec 2019 15:00:58 -0500 Received: from mga18.intel.com ([134.134.136.126]:9779 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727033AbfLDUA5 (ORCPT ); Wed, 4 Dec 2019 15:00:57 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2019 12:00:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,278,1571727600"; d="scan'208";a="236407731" Received: from jcourage-mobl.amr.corp.intel.com (HELO [10.251.152.230]) ([10.251.152.230]) by fmsmga004.fm.intel.com with ESMTP; 04 Dec 2019 12:00:54 -0800 Subject: Re: [alsa-devel] [PATCH] ASoC: SOF: imx8: fix memory allocation failure check on priv->pd_dev To: Colin King , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Daniel Baluta , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20191204124816.1415359-1-colin.king@canonical.com> From: Pierre-Louis Bossart Message-ID: <33fec540-e97b-25e7-83af-575f19d829d2@linux.intel.com> Date: Wed, 4 Dec 2019 13:13:45 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <20191204124816.1415359-1-colin.king@canonical.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/4/19 6:48 AM, Colin King wrote: > From: Colin Ian King > > The memory allocation failure check for priv->pd_dev is incorrectly > pointer checking priv instead of priv->pd_dev. Fix this. > > Addresses-Coverity: ("Logically dead code") > Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support") > Signed-off-by: Colin Ian King Thanks Colin Acked-by: Pierre-Louis Bossart > --- > sound/soc/sof/imx/imx8.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c > index cfefcfd92798..9d926b1df0d7 100644 > --- a/sound/soc/sof/imx/imx8.c > +++ b/sound/soc/sof/imx/imx8.c > @@ -209,7 +209,7 @@ static int imx8_probe(struct snd_sof_dev *sdev) > > priv->pd_dev = devm_kmalloc_array(&pdev->dev, priv->num_domains, > sizeof(*priv->pd_dev), GFP_KERNEL); > - if (!priv) > + if (!priv->pd_dev) > return -ENOMEM; > > priv->link = devm_kmalloc_array(&pdev->dev, priv->num_domains, >