Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3548876pxb; Mon, 24 Jan 2022 11:59:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSstUv967WqCgPqGFVlMzQGjl8+p9rz2LRbGx8IrlhTg1ytM0/a2BZXnjqxFA8JxqyPOi6 X-Received: by 2002:a17:902:8496:b0:149:9fb2:865c with SMTP id c22-20020a170902849600b001499fb2865cmr15602525plo.51.1643054247654; Mon, 24 Jan 2022 11:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054247; cv=none; d=google.com; s=arc-20160816; b=DMHBV0CHYDdDiu8iu4nQYj6LF3ZT0D3Hhcy41ImVqM8CfZwq4S7iO9pafAis0d/GoY mvuasbjS4SSlTD4FsUAVrUVd1BABWXGjLuM0YdPG1iIgOB7voS2Upgut2P8M3h7Zmri6 wt1Ooj1ZWM5Z0Vz/zLOkJ5kw7dSIGq5n64DPkvwntEyaB9ewGrVhL0O1rZri+dG6D7Vu vErNwE52lHTxzZPTmbC9YrfIDq8vJguwOD0hvwY8XpILHDmlZD5vwBZInxdLRXrCFkrD hyABySOC5M1pmNazu2HSEY7BP6i5WRxsJRFJHsuIrxYGDASVVReAk0gLqh4r71/BRZn7 nuxA== 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=XOecEvEfl1QO/0ncXOq6Xm9ttuDh5SQeNNeVXioU+uPQqJZFhhyzqKo8LcGp+cP9ZZ pCLuDK2BqYrhn2DXSe/8dZ1z/yHAH7oaiNXhd50ALhZPHYL1IWO7hulQ537855hsZF0H zGH2+5esjsQ9nfoX933DB1QDMW2CgTOnI2sccFmCIoUpBNBT3N3F4opsf4u69mwO8QWC GjQEQZhg2ea3VCAoo34lWxvhtEuPNzuEcuB3IP4Qa4tzTXah7zf8tZac9e8wp1oIurvo BIqIjZFSBL6GaEw3hmGwuK6ZkAUvTY3MzkND8f5eGQ6vbiDxI6L20/uHBmnZLOA1+lyv lMhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ju+cgYgh; 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 i6si14293402pgq.608.2022.01.24.11.57.14; Mon, 24 Jan 2022 11:57:27 -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=ju+cgYgh; 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 S1343526AbiAXSwg (ORCPT + 99 others); Mon, 24 Jan 2022 13:52:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343617AbiAXSvJ (ORCPT ); Mon, 24 Jan 2022 13:51:09 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C45EEC0617A3; Mon, 24 Jan 2022 10:50:46 -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 ams.source.kernel.org (Postfix) with ESMTPS id 68941B810BD; Mon, 24 Jan 2022 18:50:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9980BC340E5; Mon, 24 Jan 2022 18:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050245; bh=ZKj5uNOC/s2GY6wnIqIljyZ3oiYEhoGF8RHpon+/GPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ju+cgYghedEWVbVAGTtpRu5pyHv0ZqcKp+4PaOKiQUsi+PQO+ifIduTMlARTvjCZS Ph5CrOT95UuZGBamz4j8gqtQP9VLk4mkxKRxKYxnUTGmAVNlmHxE+HWUmTTek8oNGj 1vNYn+O1/Ph0VIJ+imD5sYzwRScIsY3bW9U5xjVc= 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.4 049/114] uio: uio_dmem_genirq: Catch the Exception Date: Mon, 24 Jan 2022 19:42:24 +0100 Message-Id: <20220124183928.616303968@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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