Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3707879pxb; Mon, 24 Jan 2022 15:58:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuCPJfNtWrfs4N8B0JbAjbLAxmfwGm4jJWUDBO3CrQIXJ1ASQ6/m3A+mvrkOYSob7C2wle X-Received: by 2002:a17:90a:f283:: with SMTP id fs3mr634982pjb.173.1643068722252; Mon, 24 Jan 2022 15:58:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068722; cv=none; d=google.com; s=arc-20160816; b=yILZA8Ab7CHCIyq/TfR4VikrvYD8E/nKlthxHHsUdU5z6drjhD4qXreUBQ3yk/OshL U2MUW98ZvQCpgCR80ZOmE3aX+aKBt+PrpxhcT3oBQJ1I9PwCtE5UM3viz/V5XYtTi046 OaZ8tBvEfHIbQePAKOxTDoQxPA5frAzV5sPgBqAUsNUqyo6LPzBoMqTV1LlUXtNjPyiF 8+va2BxmchQJUYlBMWYXUSPPMsGSqJTvrsvl6nFIroLg5pysYJkPdY5lwCQb4srvC803 JrxYAvOowrdVEFKSf4VZl+KeFI6sO3JTeXCyVQcXYLQzTsKG6HhZ6CrxEhsv3VswP9/g 3udA== 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=0cCKzunsXPbY+b1+hKK4XC0qYtJpC9cyWOjfMOHoClnPbSksiz0eoP3KX/FTA4G+yl GlxhQiIENiTyW19LW41HPLAN8zVPeSvgjv8bh10e9SqKV1X1rtwYFpnqGItTDs+UAQNN WMNOCwLk7C0JvweJWeN3uOB0cT+1IrPaYIdibVXeXPBjZPLFjw92qvZsH310jh2IoWEa ZTv8kEPK9JlNveXNc1duLrOxIqa8tL9pKo0xhE1V4L46ksBa2Xq/IOJKMm9Egin4+07L 1j/L1CWOpc9hBVGRUTGouBTpPJ+z/Zap1c9x9klpR499dFwrTncrFqgUfXWzBOKUHbiW lUSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=swGStBzQ; 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 z6si3447658pfe.233.2022.01.24.15.58.30; Mon, 24 Jan 2022 15:58:42 -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=swGStBzQ; 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 S2366010AbiAXXwJ (ORCPT + 99 others); Mon, 24 Jan 2022 18:52:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1845355AbiAXXMI (ORCPT ); Mon, 24 Jan 2022 18:12:08 -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 B04DEC067A44; Mon, 24 Jan 2022 13:19:02 -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 4FC7761469; Mon, 24 Jan 2022 21:19:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29807C340E5; Mon, 24 Jan 2022 21:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059141; bh=QGCFPH1WYvDgr9p4O+VQEVXKCX82xetHO6mmGWOWw2M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=swGStBzQ+zlmn9eToWmrcllx0TqZ2ZFgOQxv14PT+sPSTDzOCB2aDbEOhSzpf8FlN uOG0nd7gWda3gmmoMblf62BvdTeui2hmoYOvAdcuxNHRoyHFvDGcxXzje7Kww7Jjlg vf7/qwMWchZk+D0ROlZSXCfbUVMd7/GfZSrZYHHM= 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.16 0474/1039] uio: uio_dmem_genirq: Catch the Exception Date: Mon, 24 Jan 2022 19:37:43 +0100 Message-Id: <20220124184141.205188392@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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