Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3572276pxb; Mon, 24 Jan 2022 12:31:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1aS6zH9KG0MEZKeAJeZu6F6bzpE05cBRRZehJqjGIJwZpBamtGqon+h9nRh1b5pSjBeLt X-Received: by 2002:a17:90a:e7ce:: with SMTP id kb14mr26875pjb.202.1643056293135; Mon, 24 Jan 2022 12:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056293; cv=none; d=google.com; s=arc-20160816; b=SjWJiKQ59BnSe7UU/PdpVnG1PKNNyYuA1o6KusXRORWLeXwFQalMtWyyhIv+DFfQs/ OB+iZ9of81tQWEJi/KU+VT+Con3wg0h3v5txJhHdvK9LjGGL+iV1Epi+nlkXsx/bRKz9 OwJZMDL/9XkwUAAg++Y/KFLUyL6O9c8sfJtf/b2+2XjOnwqPyak4nIOXpLHAIjmZd6kx B/lMvZ56agKNsu8e2nq6JYs/WmLZ+F5kpE4kIkBLyMVt1z4EH+YQlce36HlftfaJ+WDf 71wjiVpy+yv1IrDdZtHAQex/+B65D7xhon1OaDVzICUJvYIHctwu6v+vZWWTcu1hwgg2 4zwg== 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=Vu0uWWrAXlYkIaE/uJLNp7TKu9DFPDVVfbsQgdzh60Y=; b=DxRohqxBALRIdq41WJDNrpUfkqpgW5gdsEm2sBYwYw3Azk+xOWr3ZOTJfxnFe6E2O6 XX9XPR3iuEUD5vhajsY9f8jGUBm6gGBe+GlNqPzr0LOGLTkm3dxe/hRsOHIUD4rpURdN FwMXYBZTMSMbxEG5bSvMfrQSu+yd8vBu/xU6fLwnOL1hjscnl5aM/N2nOPBzmVjs3B/U Np/inY6PY8Me0M4q9QXKZZjJD9qZSkgNdXTHhfhTlbPm+q8s3XiOrF9NHqqb/+DiaAjU nI1WAFGehFlfAjPlX8OLVcjw1R3TqGtjpe9cEqR9owzjo6qQIiMyZV3bSU2Isp7bSyU+ +hcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=guAuDynl; 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 r7si14601810pga.144.2022.01.24.12.31.18; Mon, 24 Jan 2022 12:31:33 -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=guAuDynl; 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 S1354739AbiAXThr (ORCPT + 99 others); Mon, 24 Jan 2022 14:37:47 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:57524 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347726AbiAXTc1 (ORCPT ); Mon, 24 Jan 2022 14:32:27 -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 83488614FF; Mon, 24 Jan 2022 19:32:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A9D3C340E8; Mon, 24 Jan 2022 19:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052745; bh=mqGBQO0RBQ+6UJAqYAr8k4AtoulFgo2/JKjKWkwUVn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=guAuDynlZoFpsz9/e+5ALs4ovfkesO4fFECDRFo6ZHXbOp3oaWk21nYyOpK89CiMu +0s5vDHThtD2W+7HICKum0bSnHLYgOkQgmX4tS+/hKpwbruelKg5S2GwklJheA/Kg7 YJY64gvihpxpJiiwH0vjOJfQH4j6q8aOgCsa8814= 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.4 133/320] uio: uio_dmem_genirq: Catch the Exception Date: Mon, 24 Jan 2022 19:41:57 +0100 Message-Id: <20220124183958.189526620@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 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 44858f70f5f52..bdba9dc06f63b 100644 --- a/drivers/uio/uio_dmem_genirq.c +++ b/drivers/uio/uio_dmem_genirq.c @@ -192,7 +192,11 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev) goto bad0; } - 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