Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3559704pxb; Mon, 24 Jan 2022 12:13:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAanz6ZTus06fvEQZWk5OcLD79oO9jar1yYqi+6h01aLe81cqK4FDnt5JoRyvvPx+Yb7W8 X-Received: by 2002:a17:902:e84b:b0:14b:707a:2b2a with SMTP id t11-20020a170902e84b00b0014b707a2b2amr703901plg.69.1643055183056; Mon, 24 Jan 2022 12:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055183; cv=none; d=google.com; s=arc-20160816; b=ECwZkF8F+4ma2xPMpgAgBw3ZASPyRspZ4tky8+K+VL5bpczRIwSoq5xBQTcBnmOuiS gI1Yg6Yfi/DNLrCttjcx3RoPjKv2W4v2C/IQzIiWKT9O2O3/JWz+s85RSKiFdksxoGWn Mv140+YV0tD1s7vk6nT04aCyGVtDxc2TQ7JgmKMY9uafrq1P0RXim8c4oQOfViuSjvUe Z3pqkeFUxWPItdo6zvU7psqntqWK19HGUVuOL66p8Wucd8bD49E93gbYSVijyWAtjXk0 MhYKrbGXiM6LlB6MWCFxCPzRzlz9rb2VWhQKo4OnJRHQ15JCT+qLfZG+7NjM1O7SUbSU TujA== 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=XJobJGE8FBqAmbxZZW7HGu1dXMWH6bJrqzrjx3AaWp0=; b=PjhdNOOnMaIKnins2wr34/hwIGWh5shee0xMLGlWl9zrQJXkj4Y7L0tw/N0VfJEzCx IoPCUCZlqStYDUU9JHnh3WbAIvX6wSSGCD17T03UOue4o/FGF4xoP+tpL25p7DoHoL3F y8DT6Ao+iOkjrU0eBpEAdrRgHN09CaNylcElMAMk3ngponpWS3imgasAB0sNkB/b+MtO LVLONWsFExojY4sPl9CA7a4So9GxNIJXzv3sWmx1ts551jK1bQc2Zu71WLjtleRfsS8q DmiA27Ix2lD95pcvGTp0ELl04/ThkYmLtHdYhStrKpkdfVt695JSPccGXAOzsiRlHOUl fg8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RXp2D6WK; 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 f71si14200105pgc.342.2022.01.24.12.12.45; Mon, 24 Jan 2022 12:13:03 -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=RXp2D6WK; 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 S1344561AbiAXTPt (ORCPT + 99 others); Mon, 24 Jan 2022 14:15:49 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:36290 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345767AbiAXTGX (ORCPT ); Mon, 24 Jan 2022 14:06:23 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 21FD560B86; Mon, 24 Jan 2022 19:06:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE1DCC340E5; Mon, 24 Jan 2022 19:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051181; bh=MJJ8negSy+ve/uRVf/CAfpvBZyQ7XE5bk9WJWThHUtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RXp2D6WK0eRxyZspcmqIH1LTsRNznofiBCIEM/IzB8pS5bbBhd3XH1OoOdmiq7xIg /9VBjB7XAfr5Jr4/gIFrOZcACu8k3tNRP/uRMb4LPPwyz7hWUY/i0tIatB9AT/5Jnb 9DlfGGSHSZAytdt7+rxOIQBcDgZUtX/6Zo4tZUOY= 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.14 081/186] ASoC: samsung: idma: Check of ioremap return value Date: Mon, 24 Jan 2022 19:42:36 +0100 Message-Id: <20220124183939.725682278@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 a635df61f928c..2a6ffb2abb338 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