Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3635728pxb; Mon, 24 Jan 2022 14:04:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJytXRDwT966Z72izCQMjQ++ROIJDnC17ZZ0xpMEZ+TlHEEGTclEn+sYXCcm44t7KB83LoE/ X-Received: by 2002:a17:902:9b8c:b0:148:9c40:690c with SMTP id y12-20020a1709029b8c00b001489c40690cmr16448174plp.8.1643061877257; Mon, 24 Jan 2022 14:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061877; cv=none; d=google.com; s=arc-20160816; b=kiNU6EodDHDcgr/ZJBl3J/4QQtsdNL0i4EBetginnBnPfgpXd9yJADqrLI/UrE5kjW 9RtJwXLIFukSxcthmtIji7ua0J8MrjMGrmBIDrl4uD5fw5aCTD+qH/+U6IMG/6bR8jk2 T05JGBpbl60R6CFl2Nft5UDRIgsbbw+chnr2CSm5NDZ8ipDtAfrbel5VZ5a8igl7Ymj3 24qJkNcwfikqcFZZtVRGtR7hDO6/l3du6gDeke6+HCwxDq0D0RU+MtDI2Sr+XD77xjJa ZS/yWfSREyYrbYcHgPlDqc6KF68Pp5eULnksu9o6IVfxhjR2D65x9V2/4bOygSmahWTN ItGA== 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=kZdNCcFnsokDIt12tVT2OXmil1Zh3npBAZ3M8/BsSmM=; b=V52GfsIeP9lXKn6s6vYJ7jApe9drQwUTgvHbgNHvElNuRh3t9dJlH3C3dO3ArGppx6 5OjAyQp64xYdgvq5ZJi7STqGW4hsoh+PgXs1c/kLjJ0FqQQWLzawgllikTEcHae3hb9X lDU4uGkcl2dy07Lnczq0cVrURN3ZYNx/LOYAqiGj0Boefa2BZ92vGj7M+fXldmdW6JbA xnzWD4lee9LNM4ZRJg7RcUnUrGKx8GL0njyw0hh2/cUe0vHFOOlIGQft76tLxISZEzpE DcA4KzSsCfzYzQusN26LnQEk39w4h2urKqjDDaOUukGoeMetvTrT7ihKCjEn0wOgMtHb 73EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kKdqxAVC; 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 b12si15031328pfv.230.2022.01.24.14.04.25; Mon, 24 Jan 2022 14:04:37 -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=kKdqxAVC; 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 S1575643AbiAXVwK (ORCPT + 99 others); Mon, 24 Jan 2022 16:52:10 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:38074 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447080AbiAXVTI (ORCPT ); Mon, 24 Jan 2022 16:19:08 -0500 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 2E062B811FB; Mon, 24 Jan 2022 21:19:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41B23C340E4; Mon, 24 Jan 2022 21:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059144; bh=IRR7woKXRTUuwAj7dh3xDIZETJ6KdYf3GLSVPriOUYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kKdqxAVCqAYqMe/47QtWUfd54Dl6R1kqSRmDp1LXZyl7MHSBsIjouXj89ZDiZbJgG jL3Fe5ebgIUS+DbM2/ZyPGYHDt8azBPnhvdXj7LKi/slNIKyCG715BmUrdlE5t9GL1 ZvA2cgKlhVVNKOWumSaoCrgECpycASXKffYc7CwY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Krzysztof Kozlowski , Mark Brown , Sasha Levin Subject: [PATCH 5.16 0511/1039] ASoC: samsung: idma: Check of ioremap return value Date: Mon, 24 Jan 2022 19:38:20 +0100 Message-Id: <20220124184142.463537167@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Jiasheng Jiang [ Upstream commit 3ecb46755eb85456b459a1a9f952c52986bce8ec ] Because of the potential failure of the ioremap(), the buf->area could be NULL. Therefore, we need to check it and return -ENOMEM in order to transfer the error. Fixes: f09aecd50f39 ("ASoC: SAMSUNG: Add I2S0 internal dma driver") Signed-off-by: Jiasheng Jiang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211228034026.1659385-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/samsung/idma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index 66bcc2f97544b..c3f1b054e2389 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -360,6 +360,8 @@ static int preallocate_idma_buffer(struct snd_pcm *pcm, int stream) buf->addr = idma.lp_tx_addr; buf->bytes = idma_hardware.buffer_bytes_max; buf->area = (unsigned char * __force)ioremap(buf->addr, buf->bytes); + if (!buf->area) + return -ENOMEM; return 0; } -- 2.34.1