Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3990632pxb; Tue, 25 Jan 2022 00:51:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoIef9s6gX2Rt4t2R7DaQvjmoxlwm4KAFEiVMuzFK9srM9G3o7UoH7UBs2amK6l1u5ZYfB X-Received: by 2002:a17:907:1c1b:: with SMTP id nc27mr8232664ejc.618.1643100671500; Tue, 25 Jan 2022 00:51:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643100671; cv=none; d=google.com; s=arc-20160816; b=JQP9opwQ18kkam/jNVWn58RPq5DS4uSbtD1C+Vr2X3CWCTECeJLBp0lvvIc6gerYI6 cXOedvtdjt4oIyahtS4JYafstbrLxQ6zYRR8GdYjdJFZeHBQ/vQ1Negy4XQskWTIOHoK 1SdX0u9h+27snA+EPyjP1wHYQRwVyD295Iti9tLfZefxxRbK5K6DXuQMg8GAHNxdUIeM grwSfYxvZnxHEycT4sdPGGnKTvN4d2cQUiNmsaPuBe3B2qf+yxnHxCfa0Hm4P4bbkPc7 xHqGwJt+G8ODwWmkoOMFwsF5Hq8t96NXQOekj9v9teiVZ2hEZjFQK/V6NdGTCGhEgmBD 4EMg== 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=gt+n8MtDsh0xPHGKxSEssevrsVfkQ44Tuw9ckIIYkzst/TeAZ8rDCT6CqibsP4M9sy 9vya/q+9oK+eJPOB09gV/dEB9RXDzHtlcm7by0+HnL2k5Pi0IqX28ClCnw818hB1Mpv4 nl0inoOIgzIrccZgkAauMLsxSyJnk84ggK3Wky1f8jWGeNOMKsXjTZiYU6QBIBqXBM7x +YbnJX5eWwdUrd+hGPX3MHodWp1PcPPOzHIkONISiZ9HKUEKHljfQd8b46OnF5wYRCve RVHVF6Ky+htZVdRiALZpYp+y6UvDLPiu955rQPCIv0QPCkPIVnSNM9CDodKS3nGZz2Di HDzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Kth9V8Rx; 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 g19si1917830ejt.914.2022.01.25.00.50.47; Tue, 25 Jan 2022 00:51:11 -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=Kth9V8Rx; 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 S1323486AbiAYD2g (ORCPT + 99 others); Mon, 24 Jan 2022 22:28:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1322224AbiAYDV2 (ORCPT ); Mon, 24 Jan 2022 22:21:28 -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 D51BFC0811B5; Mon, 24 Jan 2022 12:33:11 -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 B15DF61538; Mon, 24 Jan 2022 20:33:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 789F1C340E5; Mon, 24 Jan 2022 20:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056390; bh=IRR7woKXRTUuwAj7dh3xDIZETJ6KdYf3GLSVPriOUYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kth9V8Rx4iETZtmNfQXxmvb4mQ6pedK055RSkpVYrd5gp+Ir2KbAPADCSDgeDCHlW /pqZBh3oUfF7ljeMVokFVNiFsoRVzV+6APoEs0+WQKIgIt3ns25SxpYCJpbl/a2Q8B zOXLuxXZ+t/yDmY9L+XJ0SWwiLD2p/+DerbQl2n4= 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.15 435/846] ASoC: samsung: idma: Check of ioremap return value Date: Mon, 24 Jan 2022 19:39:12 +0100 Message-Id: <20220124184115.992572282@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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