Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3548117pxb; Mon, 24 Jan 2022 11:58:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyk9/pFgXeazXIu1y8V9Sgmd/y3dnRLGhl0yalXM3OYbRt3I3j1wZMDyMv0UwhKbR9Sf2jl X-Received: by 2002:a63:5010:: with SMTP id e16mr13045093pgb.529.1643054294034; Mon, 24 Jan 2022 11:58:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054294; cv=none; d=google.com; s=arc-20160816; b=liJBaAYYc/v76AHft/UUplNeI9JY4Tq4p5oOShbpJefwN1C6fBgAMj0l6BfrU6qBsj Ao6c7Vh3UsMeKB+y7jJpkeATsbNRTzZWNSd90P6L5uDe2RZLebNFiQyDdbBMgiOMxP9u jG94EEue+J5QSi2rZegfU3ypOIaE08GoSnO0SFARMsXt+YVzsiMoXLbd8FxYNAdeCYLg yIf3prveuyKYENSE3GKV62Hgw82qfVvYqcwdxMUnLmvVz99xapx8NYJ9ORbGV74q4hVO B5M5UhiF92n9YI0CZuICN92ugpk2sUbdcHSpmwC/Djj6hYbk0WC/FkXnZiCE5jrqoewC 61cQ== 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=h8X2mVf3JwopBfRsYOeHZTnxe6eUH4l8JoXvxO/d1D4=; b=uFqdo77WJ2T2ygRmkT1XHvFXKSz+cbQg+YhpAvWx2YpcIuBqsh41p069RWSwt47cEJ b08K9xIZ8/nZodxF1dljbNQVjwSGY7rbQcSAL8DNe8BBUejDTAv8DE5GQ6i+xZG9eoBo FgzpSzXbUrnq/H3i8UXBGPuL1LAU7r/AvxM4IE4FGIa9MFSTpTKj2+bz6P/dBcuDnw/7 CmVGAHnnqOA7j3HDi0L07EMxIKiWQ2c4852pPxUzxyoxYJaCwak38KdRp09RAYtrTfZP 3RLaLjROnjIn8uryRdxWLfUIMNE8vhPevpdF4MTQ8gjp00PdqE28G1N0c/UvjsTHs6de IELQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Bd7GJW9R; 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 k26si17512100pgm.320.2022.01.24.11.58.01; Mon, 24 Jan 2022 11:58:14 -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=Bd7GJW9R; 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 S1343949AbiAXSyV (ORCPT + 99 others); Mon, 24 Jan 2022 13:54:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343592AbiAXSw3 (ORCPT ); Mon, 24 Jan 2022 13:52:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9EA0C0617AD; Mon, 24 Jan 2022 10:52:16 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4A8CD614E5; Mon, 24 Jan 2022 18:52:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CED3C340E5; Mon, 24 Jan 2022 18:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050335; bh=psuyDMM6MvL9f/VYUohhevJw8G1rkBO4hNdRr21J+v0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bd7GJW9RTu/fYm8ZDBuRPHDDMRpAyvx8kT8Fu5uncAusESUUD6VqQrVGfHxM3UdcE 1qzdMdPNhkLjFPLD/z8wPtElIZXLLMopzEFtRCH7ILuqbXWYa+il/0oSdx/l48GZ6C 86//xFlLuhQ2CEiWiYshSkWdvLCi6mvp67s+i5kI= 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.4 052/114] ASoC: samsung: idma: Check of ioremap return value Date: Mon, 24 Jan 2022 19:42:27 +0100 Message-Id: <20220124183928.707294544@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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 4ed29ffc1c54e..d9cd9350ffbe2 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -370,6 +370,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