Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3559457pxb; Mon, 24 Jan 2022 12:12:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyG4hAC4STnkrUWgDLZUsIyyFoEeQTDRAZJKhpq3EC41HPPd26aX8qlunThcGsjADwgHF23 X-Received: by 2002:a17:90a:d591:: with SMTP id v17mr3509319pju.135.1643055166585; Mon, 24 Jan 2022 12:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055166; cv=none; d=google.com; s=arc-20160816; b=jp4i6u6dFg+jmzR+ICd++7J5y+DdNX7jgRLJfcgQqm/5/HXHZhmlDXDjsXMNi7dK7S w29JaVB6nVEmlDD0kbSEDa79vPUhq6btnIw9OsBkHl8OQpvvasoxY2br/duEVF0d17vz pV18y5VlytKDlWkVBnDqvJGJPrrQaTJ76OjUYj9Ca4nk/h4v3Hax73t/oEcZD7Ww5fnv R6bEZLWyrV7Yh4NcJlQM94AnwnN27g5Ffg7SZDUbkTjBJtgcPyb0cnYF+nXcs36jx9rw EqMCfaOOATvtcdlq8CgV39LM/kHuVGsd/bXrUJ5WvJ07Ml9pgummwR5Hg6UJR2vo/bgK aIbw== 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=iPHpw7gbIG/UBfsEf1+FLfQs1NdUJtZcfO8b+YLI7Tg=; b=W+8+G/kVEW7NpkmNs/czHLLWeC0QZRy3lcpCHC+QibdJnJhXBNAV2wk5CvfMPs2Cxo Qt9Flzg0zfyM3Iyz14q+F/0KyLFL9Hjna1xh2HKNAyEItU2JCs1mkSErH6/1aRs1xRLp jR8SDJj9ix5jmVDueXVug0Nn/tymYJ9FQdcEewOrINwwbOmRBWUnJEp1ZSrZ2DrJELks pYuV/YPxqnAD9bIiFqnMxFSHmMItAjT/13TAbkf0O8PePw3F5easEhZpcjYM2Zvln6HK b8wYk/wcWlxFbO1PkSPjTxoboPL2Bl6hWd185k5WoPEIEu+sUXUTXkzFuJjfzbod8X+u Chhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mQ7UjOTc; 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 d11si14520754pgg.106.2022.01.24.12.12.30; Mon, 24 Jan 2022 12:12:46 -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=mQ7UjOTc; 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 S1345883AbiAXTPj (ORCPT + 99 others); Mon, 24 Jan 2022 14:15:39 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:35704 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242569AbiAXTH4 (ORCPT ); Mon, 24 Jan 2022 14:07:56 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4A877B811F9; Mon, 24 Jan 2022 19:07:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68477C340E5; Mon, 24 Jan 2022 19:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051274; bh=ZKj5uNOC/s2GY6wnIqIljyZ3oiYEhoGF8RHpon+/GPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mQ7UjOTcg8dFVQW4Nbv/ysH+DABPDdtrBxAI6eRWWYo+Hl/JbkTkbPdbGTT8qIwpG 7fFBigJoeB8xkdmD4aLiOV+ixUmjfytZExt+qG6H0JuL7fyvq7YLR8JCRx87wpycxa levNP7zzcwnnQBytcvTv/CZE+OEhfuYsge3iE2tQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Sasha Levin Subject: [PATCH 4.14 076/186] uio: uio_dmem_genirq: Catch the Exception Date: Mon, 24 Jan 2022 19:42:31 +0100 Message-Id: <20220124183939.569625558@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 a00b4aee6c799..a31b9d5260ca0 100644 --- a/drivers/uio/uio_dmem_genirq.c +++ b/drivers/uio/uio_dmem_genirq.c @@ -194,7 +194,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