Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3555790pxb; Mon, 24 Jan 2022 12:07:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzzQjAd5iE1Cs/9U6tS2bGBsMIEDc24E5XRMzF1su+jXya0lF2MqysYspUM6gFMTobqD98 X-Received: by 2002:a17:902:8307:b0:14a:8dc0:8fed with SMTP id bd7-20020a170902830700b0014a8dc08fedmr15458885plb.53.1643054874222; Mon, 24 Jan 2022 12:07:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054874; cv=none; d=google.com; s=arc-20160816; b=ZhlBxoVpV6wQMMRAb+GPWam5UbxadP1X+45uw2HsOrI4weI3xoftxqZ6XNhxXxyred gzOC9Wa3AkfdY6TXUVYw1jO4cCXXp0Z9PGqzW4xfXtLjLbFUfUBzSt85pvs/kWH7RRx0 4t0xfV6hZB1nedAbaeHX/MQYZBtnfGfKsqyvbjd/S5kCIcWVxbMjnsDST+R/kwUez+Jl Wmo5a46bS5w2FFpFBOvDNQ//aS4XRD7+JDKmNxvpdcTolMwFPdUExSUvoIRIHmYE/yb5 9YKT6wE7WSarYL1ooZIDgJ1iSVbLYiILiQxkQUzdczGsnyho8q0Z4F5CJyAffJVNhiN2 oWig== 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=XzFncn4Lo4WqwiiAmFgoedFsR8N7VoiRS9oQbVG2HCc=; b=SCKNtzEc/Szp5mzuCihcwaa02bPxp0q4iiz39SzEzt83akY949XcE4savoAYclsxRh snnE2vydCPYJklH/8nqAeMZYPSHtzv9XFZBkf2zMq0v8N6RNiovbJw6dAouvFx66+ZrW N6Qnt/3QAhtUr/uFmnkog+AK4pA9yIU8+0SOSdXCEZW8T/DWfHkNuDs86+shOr0d4y97 NI3o0Fq5ejY+xCO+WHOqEAEIA7FnSPpMEBkQXrP/OiKMDYsdAEIBVNCHvMbaYW1X+Ycm 1+iVc5R3x1GQdOVERc0Xk8Nc6r8Tiqb9AZIVy3OSi/BFLoIGxYnJnS47cPofGtY4hRRa QF7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xCGuxkcX; 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 f11si3782950pfe.328.2022.01.24.12.07.42; Mon, 24 Jan 2022 12:07:54 -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=xCGuxkcX; 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 S1344480AbiAXTGQ (ORCPT + 99 others); Mon, 24 Jan 2022 14:06:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345433AbiAXTAR (ORCPT ); Mon, 24 Jan 2022 14:00:17 -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 55D74C061395; Mon, 24 Jan 2022 10:57:30 -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 146AFB8121C; Mon, 24 Jan 2022 18:57:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BCE6C340E5; Mon, 24 Jan 2022 18:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050647; bh=3/GDKWH79l9YKLNBw8nBU2t0luvKr2hRfUyc9c5GEiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xCGuxkcXueGrj5qbWx6e/NDz6jzE3oB+BXtA5EbY4/9JEeDjARdZow7uCyh9o3wWK jtzqsOfInWHCkdt8E789G0ik703m8RS6oSxkbeB3XxNLU0RK8Wzu5DV/yPFCT0cWlI G9i0brfbnPtrJhNLV8/X/T4Fysfeti5xmRJ9DTWY= 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.9 068/157] ASoC: samsung: idma: Check of ioremap return value Date: Mon, 24 Jan 2022 19:42:38 +0100 Message-Id: <20220124183934.947037909@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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 3e408158625db..72014dea75422 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