Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2680372imj; Mon, 11 Feb 2019 06:57:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IbV1XutnkkI6KRONbsW0MHo9JVZKfutHgJ3GpeF2VZOekOdvc0xKJbHrs0yll/j2a2xGkOX X-Received: by 2002:a17:902:7d86:: with SMTP id a6mr5742820plm.41.1549897036441; Mon, 11 Feb 2019 06:57:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897036; cv=none; d=google.com; s=arc-20160816; b=U/YtSJCXutf3TYi1wwr2ZH34FM9s2Cz2RRLe7iJ9w34lJORa6IHrEPuaBj0D2yZBX2 f7+vOYcU8oKO07RpQ8VZvjwpChJutUdWkNllI4OjLKcRHO5gulFXHmQT9wQ2AEGxY3Dm cqbXLrdKF70NPIeTqeCrwiG1hM9kalWsXNjhTr+AqcoTYgXyRJutrejOPZLpIVy9QH3f v54jcf0CZWeBPeBbvzJmRUdftF62OtTHmpoRANxUuKN1g1KnftuVeAdwJji+A3K8+SRt OUXoDZQfk4x/fNZohMaAxGvL4C2EI9o8dXViUxyaE8yezlz23qkinJ6B3ILpG60WCeJR CI3w== 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=hF/L+Nqhrs+XUWc3rOOa8tv+hAdyOcDkfhSATWfCWiY=; b=remj00XMHFBxAoBRyRtzoYxZ4Ki6rbTp/4U/Swgcgn3h79M8Xvn0WdqZsx6hu0k3Lq NNiq3HvXhdHXUR5ooqE50Nl2Z0hWovAIyUmETQMUlNjEKz9SPj7PtQOeKbjji+mS/oxU hEEZUzN7JdWGCwlm/vuGeIQt5chncjW+o5GQcqa1tEeUTZIOH+m2rYZlKdLdkkZbtCsd a0xqdQJm0tdrMnvVfJUgQWRuha616IaKIO71vPOouiTc6wlIAWvK7KGtEyT5tHMnRTKM nbRB89ZIgNZVua1WP1Z5W2/AKwsihp0AkYVAGQk5x/HAW5sJwYinykhwyCk1EKAyGPf5 jhOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=niaGfrn9; 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 98si2601532pls.205.2019.02.11.06.56.59; Mon, 11 Feb 2019 06:57:16 -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=niaGfrn9; 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 S2388882AbfBKOyu (ORCPT + 99 others); Mon, 11 Feb 2019 09:54:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:41542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388875AbfBKOyn (ORCPT ); Mon, 11 Feb 2019 09:54:43 -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 BABAA222A8; Mon, 11 Feb 2019 14:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896883; bh=pviqqzT+PXc1/8/X2S/j2tiBUhF5KMqXM4C3K1Agb2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=niaGfrn9xmd6AdV+MZPYjgC4i1PBd64QXMmBx3J5k+Q+mTz5zt1GIoXskRIGZTtNf sZszMAsClGJ88T9KFUJQUSIKOnmdzSaz40HccQWbbtuqwxaJPEzpr46YBY+Muyh4ve aNnZhxBrn5naZdsauZow3+UUJLTuf2P5N1m+kqno= 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.14 005/205] ASoC: Intel: mrfld: fix uninitialized variable access Date: Mon, 11 Feb 2019 15:16:43 +0100 Message-Id: <20190211141827.513129018@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 33917146d9c4..054b1d514e8a 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