Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3730113pxb; Mon, 24 Jan 2022 16:33:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqim20xvEQytpeYGLlAiZBixj47/b3HcqmEAGEi3jzaDy6+OFai6Z5mIjVG3JyFSaxeiVN X-Received: by 2002:a17:902:9883:b0:14a:d16e:b480 with SMTP id s3-20020a170902988300b0014ad16eb480mr16591885plp.21.1643070714556; Mon, 24 Jan 2022 16:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070714; cv=none; d=google.com; s=arc-20160816; b=GdvBpEKitUUCn2/2uwYFD7Chh0dEZP6Idxss9s/DSy7jG5SKsFIwTgJr7gLePnPssF OIJcln8D8k+1D/0JYMCoexEEkyxMafkBOquqEho/sceLPxZBeSrSeJdt5zsoUyRNjgWU MJJfHUB/jcccS0OgBRJN2z1doGmsfuvqSp8yV65UdbUs7iwemwBmjqaa76caSUr/GnTN E+2ViciQ7ZkDDLg1xslM3/ldqwdojPD7ljqiFrEHVe4mE3bnGO7HrKqI9E9JBFKznUD1 7K1u6An/UR3aWnWz5mhMoCifGeXP6k02itwraERGO22M50ptYVQ4ZHcCuTxJPAeQtya5 wTwQ== 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=51fH6Xf8fSwJZyC5AFs4EhHMJWjadx2UgpQhkQXXzFQ=; b=wPuFW3TsDViXk6pAkhnhkiHVLoxGNc0enRUnx23y6VkNbUUaafIeEYTghPjkL/FxuT ltOxMVG/3daQs/g+rnyAVpcEuJspVN0J1cSp2Xi9toY6GJMTvUk4ixf3pGhqjbptWOfJ 1cl1OP+MGVRdEPYUTroyBw0hRU11k5eZAQVnGXWEkuYnn2/NYvylOVrTuIsrLSFM/Gpr K49O9pjtyfqwxWb/jsA6VeAB25d3m+8CXMlXJWmCMVitFdUBe/kp7jx2+DguJLErzusI gH7npz6UK+PY4Z1cdPOWYm9CzFCT/ZSX2GH01yZJmiUuhSHrZiZXJLQbGpNjTqS66eBi p2xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aYOR8ZgT; 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 y3si14986091pgp.711.2022.01.24.16.31.42; Mon, 24 Jan 2022 16:31:54 -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=aYOR8ZgT; 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 S3410061AbiAYA2X (ORCPT + 99 others); Mon, 24 Jan 2022 19:28:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455298AbiAXVfL (ORCPT ); Mon, 24 Jan 2022 16:35:11 -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 C2B61C014F19; Mon, 24 Jan 2022 12:22:05 -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 60732614FE; Mon, 24 Jan 2022 20:22:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 471C7C340E5; Mon, 24 Jan 2022 20:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055724; bh=9o48Je1F87lDwxkuT1N6YQqhnrPGRVS42N5wlSw4AZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aYOR8ZgTqp06OWlDS484A7kW5d79WSG2GAM5j6/RM7mCbfvZtNXkOQC9olpPDyl3w 2K5X/QI+Lj70oqgztpQzDVrGBQEQ8XKTutQcf3UC8h+VoYq4kimubymvQNUaLPAl1N 7ljmyw3QrnPNoORhfIx2K29sUAxi8t0FDv2csNh4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.15 245/846] media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes Date: Mon, 24 Jan 2022 19:36:02 +0100 Message-Id: <20220124184109.386877816@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 43f0633f89947df57fe0b5025bdd741768007708 ] 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. Link: https://lore.kernel.org/linux-media/20211206022201.1639460-1-jiasheng@iscas.ac.cn Fixes: b0444f18e0b1 ("[media] coda: add i.MX6 VDOA driver") Signed-off-by: Jiasheng Jiang Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/coda/imx-vdoa.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/coda/imx-vdoa.c b/drivers/media/platform/coda/imx-vdoa.c index 8bc0d83718193..dd6e2e320264e 100644 --- a/drivers/media/platform/coda/imx-vdoa.c +++ b/drivers/media/platform/coda/imx-vdoa.c @@ -287,7 +287,11 @@ static int vdoa_probe(struct platform_device *pdev) struct resource *res; int ret; - 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; + } vdoa = devm_kzalloc(&pdev->dev, sizeof(*vdoa), GFP_KERNEL); if (!vdoa) -- 2.34.1