Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9111320pxu; Mon, 28 Dec 2020 06:56:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmdWRfaVZnv4kpPBffq8JmXAKxy2g7RnWu7HbiIzjBEOxfl3S97icoIWQrcR3PgfLNbNOK X-Received: by 2002:a05:6402:1d15:: with SMTP id dg21mr41822886edb.280.1609167412393; Mon, 28 Dec 2020 06:56:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167412; cv=none; d=google.com; s=arc-20160816; b=YJto2AShL44DijkVK714GaS9ZODIb64thraS29+GAGXaQYdeFSV6Y+EP+WMdQvmlMd 3M8ioibcc/t8QKpRF3E+Dr4UOSeVFT3FNVN6uPZqqIaUdeuOSfWJ6fjESS7reVF7fRRN cXXuYKyDMeYJdALO/FgGbf3ahD7JEKyK3u8B1Ee7yc9dFJDR9Zi0MUXlawX62i+bxfrn DcfK+StV1c5fFeuzJSLmGrfCOciexI7uCD3AZ3guyPF7enH8pl6fYj2pxirX9nLYvlfK sayCn1/TcfCj8rblU3tkVNo06IFnZXs1KLlrVuoj8pCun+SgLyjHlFpbl5ttMJgYzH6U tZJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9Rl1yuK6t8FnW+hXGMQ/TaFnaH4nzfmsNcH3bfm/qSo=; b=NT4MQ6VbQW6T+8tt0l6LjGUZvX52Pq4vLKLDpBVyFPEzhbE0MGIlU3whtcRjtbgG6A hIznOfAjQwPaFPKWCYuoN46l7sfij4Pk33serUrH6JRpbR2h+FaxCDA6u/SSWHLmrW3c kZZw82LlRt0Zs+soq7hybQVjrGgS6xQBvVK6zp8cOzkcgSKDDNif5s4YsqAzt3NkSjcT MlsPsfmtBAWccGsMVRVE5ZYd+wtLfcERInFjxncfUsxtpzjPWw5AjXiRQg0fQNJgEwM2 ct4omSlKwffH3u7NWG0u/s4r0phpHisOJdyeuVGG3f1nMCZHMxiooqHVuJ6MzcGEfUVb TGrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="PbVV/XTJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si22114952eda.107.2020.12.28.06.56.29; Mon, 28 Dec 2020 06:56:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="PbVV/XTJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441440AbgL1ORT (ORCPT + 99 others); Mon, 28 Dec 2020 09:17:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:52306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441369AbgL1ORJ (ORCPT ); Mon, 28 Dec 2020 09:17:09 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7737722AAD; Mon, 28 Dec 2020 14:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164989; bh=Q60UCZxrw2ozqBbgnzkUMsK84+wPaDDO9eItx9L/cr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PbVV/XTJoKT84pcr7yOj4KeMEduRpYI9EXyTl+mh1OlfaA2tAMHZMQGzJW3mc7F89 dzWkPLXg+s8w9iMybAoX4yLzHmE+Lf9nmA5eXHJQmERii3Zz4I56jsgq7mUQzsY7KD a6RvGXjxlFSdvlGG4oJJnoJrh8muGZeWftg6G9BY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Mark Brown , Sasha Levin Subject: [PATCH 5.10 370/717] ASoC: max98390: Fix error codes in max98390_dsm_init() Date: Mon, 28 Dec 2020 13:46:08 +0100 Message-Id: <20201228125038.733987758@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 3cea33b6f2d7782d1be17c71509986f33ee93541 ] These error paths return success but they should return -EINVAL. Fixes: 97ed3e509ee6 ("ASoC: max98390: Fix potential crash during param fw loading") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/X9B0uz4svyNTqeMb@mwanda Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/max98390.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index ff5cc9bbec291..bb736c44e68a3 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -784,6 +784,7 @@ static int max98390_dsm_init(struct snd_soc_component *component) if (fw->size < MAX98390_DSM_PARAM_MIN_SIZE) { dev_err(component->dev, "param fw is invalid.\n"); + ret = -EINVAL; goto err_alloc; } dsm_param = (char *)fw->data; @@ -794,6 +795,7 @@ static int max98390_dsm_init(struct snd_soc_component *component) fw->size < param_size + MAX98390_DSM_PAYLOAD_OFFSET) { dev_err(component->dev, "param fw is invalid.\n"); + ret = -EINVAL; goto err_alloc; } regmap_write(max98390->regmap, MAX98390_R203A_AMP_EN, 0x80); -- 2.27.0