Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3572466pxb; Mon, 24 Jan 2022 12:31:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxH3vNu1wbLIyON6g0/F7jsa9fj6a+ipTBeogmt24dNBaRKZWPmUhpgJOogdP+8gYwPPCVy X-Received: by 2002:a05:6a00:84d:b0:4c9:df2f:51e2 with SMTP id q13-20020a056a00084d00b004c9df2f51e2mr4212357pfk.49.1643056309439; Mon, 24 Jan 2022 12:31:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056309; cv=none; d=google.com; s=arc-20160816; b=LqqZcmb+TQIavO6pTP5pfFJETE/WOGOce9bhLQ42noFnaoBNyYrQkgqpi0NzT4WFwp aZYX9nBefKWfH/JFXB1vPLotOD3vnRfX9XfksXfDqhPyuPrB3dHgdpduA2EseZEm5YFI OceEfTg5EqubZfalKMVLTrzSOxYXXWTqfTIW9dvL2l3Y6mfnrbU4DMl4TNZM+gehhwhv GnkrcHyiRH1s9RCBvPMLwbeDKT6oEazdftTEeFhERtR+Frh7SwmamsfvPe+yJEW8DBfO y9UgNQ35DqkRixy7ilVg74x1HkrCAVNxAuxEHjeECvvI6ZU+ONZrCYunBogvmGhTgNLQ +M0w== 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=aUb83WlC7+PK7QRvLTk/QF5IG8RGLISvcdClTI8c3UY=; b=MW2yNygyGhon0GEjumg8gKcSQKBeczqViAjv9MpD0ShdCegMUBf3h5ERPKmQtO5qIO sVGq1lfUQIhiHZga4mnn1r2pZrT0SYpK/aFCdCv5F6TDBJXttUhd52MkIKdJGGHn416y A5i5MMZp6rzT/kGFUurV34xdwNdeh8Bh/0MQAcbIKtx7xAAkyNEHNd0Mtfg7go1NnGkk J3doltiZPCJYcHUuHVo+wZNoDNi8+sBx5V2RvJ4BVNRv6rcpkIfCiHg7+RomXLrooI5D wvLC5yaj/yHmUvMfW6aZ5Oc4yd6RRF2UiC5atZdhqi9Yo1A4GBpe9/P7phDrG6P2jHLQ oOKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="t6U/uDtz"; 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 k20si12360141pls.312.2022.01.24.12.31.36; Mon, 24 Jan 2022 12:31:49 -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="t6U/uDtz"; 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 S1354494AbiAXTgk (ORCPT + 99 others); Mon, 24 Jan 2022 14:36:40 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:58788 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347311AbiAXTbi (ORCPT ); Mon, 24 Jan 2022 14:31:38 -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 5B54A6135E; Mon, 24 Jan 2022 19:31:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B6F0C340E5; Mon, 24 Jan 2022 19:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052697; bh=TGICEL1JlDSz94eSHY5GVl52jJkWdxOLFeLR5apU6e0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t6U/uDtz5uE99KUdLS76zZ+lC7quTTOSYqIMsvfWb0sOq0Dkczp/4PJ4/dBfh1FKj rRumuJGDDPAzCkbkXYxIg+gbpJleh08ddu9cn+xeT4aeG576+d7cvf25sdXJMS1Uib 7LLcN5e5KDg2wQ7CG/JgCYbCbj7GB6ILdrQMwifE= 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.4 146/320] ASoC: samsung: idma: Check of ioremap return value Date: Mon, 24 Jan 2022 19:42:10 +0100 Message-Id: <20220124183958.606307191@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 65497cd477a50..47f6f5d70853d 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -363,6 +363,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