Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2647602imj; Mon, 11 Feb 2019 06:26:09 -0800 (PST) X-Google-Smtp-Source: AHgI3Ial9Tm5fZJoSCrRWqd18NVrnMBNb+ML85KAqH8M7Wxgl8iv0DSnWAXDWwWqPX8CnUEdvvVc X-Received: by 2002:a63:1a0d:: with SMTP id a13mr33504582pga.202.1549895169052; Mon, 11 Feb 2019 06:26:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895169; cv=none; d=google.com; s=arc-20160816; b=y0PepuKdbsZVolu7++69UixV29YDM/bty9Fn1lOdAmErRAqo3nErb6i5d8JmKTgh57 Sju5oVC3a8nmD+Zw5a6XCSKxm3kFkgWsRpsgmYRvNQONLVsmpXVwItBJfDI6fv2CRMjw OYrPQoAZfWQsy+XbVrtK9FE4gLzDtezq+UIqV4g3VW9OEJvk9amJO1f7IwNQKl4YOEYe AsdviZMCeFTqiK2U/j9cRHZbJSf9yycfTNiwxd8ZLkWz0Kw1BBwVKt7JMDKEtkwtRTZ8 VwDzntrF7F+dRcqlm/1xysKLJ4XDWZborrxGrYm2olK4vT9HnwevnDT33VIN/F7dbrOQ RjJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kCxdxwtMEh99112XUJyoKx1/COlJBnjv08AD5IQmOpY=; b=NDMND3TQUaexvLyRrIAX9ZMWCVUNGPK0cTm46QJx1hc2lWZ3V2V+vtvzdZsPjezDiO Sep749FqDISYo4hZ8H3cJpj7jLxwvVUYVaJVpIT5UebwoIdX/RO6DRP6VxPdN9FLHJyo SeexRsOhLP1zFdpg7cFN1FSWmm9c4QucGi2nZz9GOspAmSZpKi9kmlyC/Fd/eDyeUzby F6GrdDpAErZs+KaYSpbPg0fPDHILz8Tq6JVVN48Bpq1RU2ygKIfzq0S1Poyt+nEDYPT8 40T0VO5tOs2t1gy/xH+tigGqDfjJdNmw8TIz/dRRK5HcpUgGQe4NrpIwNjqm8yJTc0ib Nz1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N8mQ63J+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g81si10674340pfe.13.2019.02.11.06.25.53; Mon, 11 Feb 2019 06:26:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N8mQ63J+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728490AbfBKOVN (ORCPT + 99 others); Mon, 11 Feb 2019 09:21:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:53990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728473AbfBKOVJ (ORCPT ); Mon, 11 Feb 2019 09:21:09 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A88720844; Mon, 11 Feb 2019 14:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549894868; bh=GrK334DDMMWOgkdPVbDuNPJ+ifvVXHSJCJF8rmhH1mw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N8mQ63J+BCiaLpCo7rMOVVk3vmRLtfJ7gN6MVtqbDqvPAeLyBYrJFyW6rIm4SVSCe wez1QbLDOVvMTzNMiQSKPDG2S8uaoNVwRIkHZRBjzR5H1tByRq8ZuyxcfjXm8+z6kM FQ2TNm+s+wHHcwxrDANSOwBzyAAA8PJlD8W60NrA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 4.20 007/352] ASoC: Intel: mrfld: fix uninitialized variable access Date: Mon, 11 Feb 2019 15:13:54 +0100 Message-Id: <20190211141846.935209382@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 1539c7f23f256120f89f8b9ec53160790bce9ed2 ] Randconfig testing revealed a very old bug, with gcc-8: sound/soc/intel/atom/sst/sst_loader.c: In function 'sst_load_fw': sound/soc/intel/atom/sst/sst_loader.c:357:5: error: 'fw' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (fw == NULL) { ^ sound/soc/intel/atom/sst/sst_loader.c:354:25: note: 'fw' was declared here const struct firmware *fw; We must check the return code of request_firmware() before we look at the pointer result that may be uninitialized when the function fails. Fixes: 9012c9544eea ("ASoC: Intel: mrfld - Add DSP load and management") Signed-off-by: Arnd Bergmann Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/atom/sst/sst_loader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/atom/sst/sst_loader.c b/sound/soc/intel/atom/sst/sst_loader.c index 27413ebae956..b8c456753f01 100644 --- a/sound/soc/intel/atom/sst/sst_loader.c +++ b/sound/soc/intel/atom/sst/sst_loader.c @@ -354,14 +354,14 @@ static int sst_request_fw(struct intel_sst_drv *sst) const struct firmware *fw; retval = request_firmware(&fw, sst->firmware_name, sst->dev); - if (fw == NULL) { - dev_err(sst->dev, "fw is returning as null\n"); - return -EINVAL; - } if (retval) { dev_err(sst->dev, "request fw failed %d\n", retval); return retval; } + if (fw == NULL) { + dev_err(sst->dev, "fw is returning as null\n"); + return -EINVAL; + } mutex_lock(&sst->sst_lock); retval = sst_cache_and_parse_fw(sst, fw); mutex_unlock(&sst->sst_lock); -- 2.19.1