Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3667611pxb; Mon, 24 Jan 2022 14:54:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzY8z/lgh2DL8LGJe16nBlJlb8NoXa1EEnzU4RkURTE7lg61wUxtG/6M7eTi9QJGsewghcg X-Received: by 2002:a05:6a00:1144:b0:4c4:8072:e588 with SMTP id b4-20020a056a00114400b004c48072e588mr15721672pfm.11.1643064851119; Mon, 24 Jan 2022 14:54:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643064851; cv=none; d=google.com; s=arc-20160816; b=RDNjPXfJJLhR1aqcaQI+VG3p3c0jJCM1ZjqX+hpZsyv+tQ2rbbiNAYsvuAb1GJJgCj vwUorWKdCmt3A1FQCMiA9bJr4e/AvAX/SD7A4v8vir0TOD1zf75AKpRfuY6aCUDYV4A2 cNe5BSCD1skqcY0lWskcHLQyXYn4nzelRQ6RkAyUYDZEdGszlbtXAKjYQoBD/NDV2YYp 1zZt/4/oIbhzhz54IFhY8YLN88D2xd+kMcJm88xZYfRLFxsoejLNlzC2PAVhrT6FWJKC R2vbiLcMCDQ6elqc5F4ZecugojZZk57/0UnhljVVWOkVF/BKE4NJ5/EhqAhq9xvaKgYF mkYQ== 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=7kSH1RunkbTXELk65fA22ykJl3Ywdnj31/lxqK2XVtE=; b=wFgVEzXk1wi9o2+s23uIHG2MB3iBG5LlQ/tVXrGWaWGvYPcOeeYmyir8MN9RpznR89 ugkaNcrznHwZYXqF/RDIcGTSjVLy35HCDdSNGdqb/p+SUfTil5/o9cGw+FcR6/SAqEj1 9hkAC5Qq/dE6ZJlQfqyhm9+A61xG3ygxmQcFu6KaghfczKi1qtnpzfubhatwMuSz5efy 91gB1kZHn5RukUrH93CQ2D2Sqmd/1zoh3EGNR09+8IDIxHbFMSTdWQxFjrclhWXZangy OBaO8TOQnQtDihL0LRjULEEJ7FCHBjE4zfbEwbY7mf/sY1urYi9eYWgT2iyq0bVnteHO IXMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P8OKTXTq; 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 x11si13623151plv.612.2022.01.24.14.53.58; Mon, 24 Jan 2022 14:54: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=P8OKTXTq; 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 S1839379AbiAXWud (ORCPT + 99 others); Mon, 24 Jan 2022 17:50:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1572905AbiAXVmu (ORCPT ); Mon, 24 Jan 2022 16:42:50 -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 BB417C0419DF; Mon, 24 Jan 2022 12:31:26 -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 5AE9361382; Mon, 24 Jan 2022 20:31:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 332B7C340E5; Mon, 24 Jan 2022 20:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056285; bh=QGCFPH1WYvDgr9p4O+VQEVXKCX82xetHO6mmGWOWw2M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P8OKTXTqq57Z4X8yKl1SJMaa1d4FmCCdDD30VE+tEb03s6CWXzhYcka7cOugsV1OY idq0wN7Y56vt9CPSyas/zzAQQmHJVzpC8HDEeilU40It4dEeIGpudhYqEMpLgEdvdX 3dwCQzd/qu1OoVbrEevzxT1bIJD6N6z5/9+VKXNk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Sasha Levin Subject: [PATCH 5.15 401/846] uio: uio_dmem_genirq: Catch the Exception Date: Mon, 24 Jan 2022 19:38:38 +0100 Message-Id: <20220124184114.788768037@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 eec91694f927d1026974444eb6a3adccd4f1cbc2 ] The return value of dma_set_coherent_mask() is not always 0. To catch the exception in case that dma is not support the mask. Fixes: 0a0c3b5a24bd ("Add new uio device for dynamic memory allocation") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20211204000326.1592687-1-jiasheng@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/uio/uio_dmem_genirq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c index 6b5cfa5b06733..1106f33764047 100644 --- a/drivers/uio/uio_dmem_genirq.c +++ b/drivers/uio/uio_dmem_genirq.c @@ -188,7 +188,11 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev) return -ENOMEM; } - dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (ret) { + dev_err(&pdev->dev, "DMA enable failed\n"); + return ret; + } priv->uioinfo = uioinfo; spin_lock_init(&priv->lock); -- 2.34.1