Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp769490pxb; Tue, 5 Apr 2022 22:33:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcHOMJ6CqhewHril+POAz4dHFkBE0NBQ/eCQG0OXxEtaKc4UXkfC6XVYlcfXmWkRm6u9KY X-Received: by 2002:a17:903:2288:b0:153:bfbe:7354 with SMTP id b8-20020a170903228800b00153bfbe7354mr7063093plh.112.1649223191280; Tue, 05 Apr 2022 22:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649223191; cv=none; d=google.com; s=arc-20160816; b=UhPuUMJC5LNvHuurSlPYUF1OgbFaZSYB+gOsphEFCImvWtttaptr3Q9yzJgV1PcAHw nJhXfg6BvJd3OJw4h2H/L5DH9swFwTLjQP8c1XAggUpRwyN6uHu6JfGqUAPdQKxpaVZi 4a+qpSYC8QtcW8ystwnMm4kPHzycQNj5c1ynqyXMw9x2Sq7RoYXzSsBvRJT9CLRiUySw ZdISRXI3wBmwWG1jfzXzQVUP7YYgLDR29dLp4kvVYinWtQT2ad9zoE9C+622knOgt9LM hyvhXcmv+npxhGzmuoFbwYfITw2WjVSMS83E/0QOHAIHCSVr6thCdrFCIr3NhvTMB7CV 0mrg== 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=oCDQDQmC536QKCUgGN0niMarZg7qK7IZQW1YP2zk2Vw=; b=Unb5YTfe+HHr7FR3CNjn8zqIb8qs3nQF2ks7XGChgmpP4wlHUzsaX3+xWm7BSX98U/ a/EU9rOIhm6B2XFyKSk9ivQJ43EpPTvI9r648AmciCjTdPQo0ZzrbQrHHdxlpxCEZKbP QKPnwAwfJMEdkMQt805SrWAXVj+WFlNkeWMqUwpZhwIAvPV7PUDfEomCVj75R3GxltiC 37QBv77XfCZ9cW8NC2qXNgoj+g1kiuFvgUhCeLoQsglLEFCidyUIalFqjTBRQmOklm61 RZ+jRnET+Rz2BWq46kSckEWKbMCDjJr2Cfeuk2uN0y7obfT8bafsL7+4Yt4L3U1NfTpL TbrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jl4Qo7DF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f6-20020a655506000000b0039abb29d7b8si2071316pgr.397.2022.04.05.22.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:33:11 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jl4Qo7DF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C7F9627B006; Tue, 5 Apr 2022 21:06:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381251AbiDEUlN (ORCPT + 99 others); Tue, 5 Apr 2022 16:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348746AbiDEJsa (ORCPT ); Tue, 5 Apr 2022 05:48:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28CF0443E3; Tue, 5 Apr 2022 02:34:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C82F5B81B75; Tue, 5 Apr 2022 09:34:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2405FC385A0; Tue, 5 Apr 2022 09:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151276; bh=1H+HbGkoLOkTW0gUFqba98LuOxAX3kAuQ/zUrUQtR5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jl4Qo7DFIbzXcx1NxuwpJkv1dH/21Gp/Ly98T9AI4roHSayyWEYu8V02ocjhLkaS5 tEJhuGNYLaG4FZka1PEq99/KgzQ2FCJC4EOUme66NHMlOlpHFzz2g3opRbZAqiwROh pFkZyLnGlg2oBcMUCNOBFuJ/MAsKmybIUOB1JR/g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, TOTE Robot , Jia-Ju Bai , Mark Brown , Sasha Levin Subject: [PATCH 5.15 330/913] ASoC: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp() Date: Tue, 5 Apr 2022 09:23:12 +0200 Message-Id: <20220405070349.741440475@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai [ Upstream commit 4d06f92f38b799295ae22c98be7a20cac3e2a1a7 ] The function devm_kzalloc() in rt5663_parse_dp() can fail, so its return value should be checked. Fixes: 457c25efc592 ("ASoC: rt5663: Add the function of impedance sensing") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Link: https://lore.kernel.org/r/20220225131030.27248-1-baijiaju1990@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rt5663.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c index ee09ccd448dc..4aba6e106ee4 100644 --- a/sound/soc/codecs/rt5663.c +++ b/sound/soc/codecs/rt5663.c @@ -3478,6 +3478,8 @@ static int rt5663_parse_dp(struct rt5663_priv *rt5663, struct device *dev) table_size = sizeof(struct impedance_mapping_table) * rt5663->pdata.impedance_sensing_num; rt5663->imp_table = devm_kzalloc(dev, table_size, GFP_KERNEL); + if (!rt5663->imp_table) + return -ENOMEM; ret = device_property_read_u32_array(dev, "realtek,impedance_sensing_table", (u32 *)rt5663->imp_table, table_size); -- 2.34.1