Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3579876pxb; Mon, 24 Jan 2022 12:42:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgDV7utkdtP5gGtm7/utfGvZy2cQuZJNS24iML0Vf/+0x/a73tTcT/SPdDTNmuEuildmnZ X-Received: by 2002:a17:902:8a89:b0:149:a833:af2a with SMTP id p9-20020a1709028a8900b00149a833af2amr16322287plo.153.1643056959665; Mon, 24 Jan 2022 12:42:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056959; cv=none; d=google.com; s=arc-20160816; b=d4vsLh2vBqFbsDWk0KDExsvk/SO0O7Y8gHePkKMBuHtqCHCg5LAUnlb7YrfCUO4kSo FnWQbWQa3o+4chspMVe5qmFNqBvXR73q/xEIECeQEobApNuOjLJmaq9IjWerJYlc1i+f a1fiM9hwjWWKoRdZrQg8wYg1Kh9EtjLJooTU/xGyknPwC2j+mqsZKMLQurknE/pG7rkc EZdMGIkJoXJa3n6jfspAhBPEgAUWIz1pCLGckPyVl91Q29ilHEvMCeW5KwWRKFZ7lm2a aP5YF2ivfB+o7rdIHVfGwBrBovxr2yiMaNyLXOD2BpOr23Jt/A58nt20jZ3mnAt9RN8J TL+Q== 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=pu3BuRi6RGWS8nOYRzwzeecCXQmjFSHOfjPhlkG96Fk=; b=SuU/e1g4/d6mTcBHMVN+9KG0pppLG0XEZ77mHEUwubie7mMN6rH7hYS1axCDc2elWI qcekQkRUy2D4F/cuciuvR+3z1mdi/3Uiyyhgz2vkzGSZ9JL2JB6MWBHvgX7I+CdB+RBM BU5rHmDxVNiyTY8l+su9U4/JkxrmsGlU5ExVO5zOuMr0EXsJTt1k5Xm4Q7d8oGPWpk4e H5BPbAGjEpZl/Psk6DTOBj//u5FURDt4qs7xXV2kmgto/otUcrOTdSXmJn98hWL9dWnH ylPgzsP4ZH6m8c2Herypqf98lrzQ+W8oi2a/6Ft5wSGH1KJV5BXNLGuaxde075M5twYD zO2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J39H91+y; 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 rj13si354088pjb.33.2022.01.24.12.42.27; Mon, 24 Jan 2022 12:42:39 -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=J39H91+y; 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 S1359715AbiAXUAE (ORCPT + 99 others); Mon, 24 Jan 2022 15:00:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348804AbiAXTkz (ORCPT ); Mon, 24 Jan 2022 14:40:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F65C0613E6; Mon, 24 Jan 2022 11:19:39 -0800 (PST) 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 E4B39B81249; Mon, 24 Jan 2022 19:19:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07B2FC340E7; Mon, 24 Jan 2022 19:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051976; bh=QMWYLrt8iQbcEWQT/CMGJk+AiXwb31DZVl21V+GXoQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J39H91+yz2I/u6FG6PevGIiCQToQ/jszeZI3NnbPUnBPbMarO7e4Qe/N4QIx3h05n PLgyKc3QTlh/ogSa2iZ/EzjtHqK83XQsQdzzBKdWMGr9MukrjQREnGccKmMvTrkV13 WPweaFB1RuxTvVl0AvB+Pb1ncZ5XnNkgBwE6L4G4= 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 4.19 115/239] ASoC: samsung: idma: Check of ioremap return value Date: Mon, 24 Jan 2022 19:42:33 +0100 Message-Id: <20220124183946.761209146@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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 b1f09b942410d..e397f5e10e33e 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -369,6 +369,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