Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3577027pxb; Mon, 24 Jan 2022 12:38:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVMMpeHo8tYjpZNDuqc8kYOEDeKegAbI1n2FrY4vey9Gpbtf+vzYgqtRqulqhPHVLe/lob X-Received: by 2002:a17:90b:4f84:: with SMTP id qe4mr113355pjb.24.1643056707768; Mon, 24 Jan 2022 12:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056707; cv=none; d=google.com; s=arc-20160816; b=StilD4sacnAO4tRIaKLs1LgKHA4mYgMZEOnRzFTncJ5ZxS7e8OVmHaIxYbL8XnWjap 8j9NMzbSHkVB0Y8tdMv7gV+TiDdmJcTUqBDagq0fUFoaDTQynhb0zVemngfoXiovN28d VMNChi6w3xpgM8BlTUsdFS4AEJrWRxRbIVKIfcXlGMj4itVfsPYkWBbTQgOI9Crr1dau KFBNqnOmhmx86wrRTf34WIBnH0YapSdA8thO/Wc2c3Jk/VQRAotvjGg8EF0uhn8Vbhy5 abWmFx/BPEgfRitE5V8ZRhS6SldcB6sunPLEPEJePeCatjgGeMT13cXtzVfhZNpNW5w/ Bylg== 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=pH1N58WY8Hym1+l+kTAQXwl7cfMhwT0zui13zsoNm1A=; b=jMPF3S0MDer/ijcY6HrAnVK8FyBd7oLmJHHduVV38Z5/23iaZMfNf8fPwWOzd8XhXH BIGZcpmFdzl5HQm0v68wTWxanw+Kn3PrLX/gVUDPEF/9xpaCGyUrXwNFZ3gopWK+kcun +QbwtROVnS+b0B360gFesJSh1GYs1te9bKO2lds0ijBRhpOKvrh/Tc1VlEHuuBtZQbN+ pFG6Ko7d43wq4nYpYpd5AR75OSQpOzkqY0K9GrtpLv7hOilRKAFKb0HS0//IWNIJ+uCG TNNyZDSgdiQbsbOx0rJLzXKuDuSVU+N00Z/ockpYTKS/VB0UUXli5MNJpL0qvq3KMA7h klfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QMt2h7F+; 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 v69si10873444pfc.153.2022.01.24.12.38.08; Mon, 24 Jan 2022 12:38: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=QMt2h7F+; 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 S1351424AbiAXTtE (ORCPT + 99 others); Mon, 24 Jan 2022 14:49:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348789AbiAXTif (ORCPT ); Mon, 24 Jan 2022 14:38:35 -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 A6236C004999; Mon, 24 Jan 2022 11:17:42 -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 05ACC60010; Mon, 24 Jan 2022 19:17:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1AE4C340E5; Mon, 24 Jan 2022 19:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051860; bh=bIveQD0UNRG8aGH1KYH14F78irHWOXLBnVi87Hh4uCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QMt2h7F+J15k4QaMRETXMs15pafCday6gsHALymWU40yZ0WIkrfhsQcz5dKO1hZzu t/MhQQJWJWQEQPYni70IZLjVzPqZ3/CI8jE/m7XxCU2HPu2MDNWxnJ7bvXteGynsvU I7yj2a/U6sLj2pJ6rkaF5if4pt53x6qNaInVm9Bk= 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 4.19 077/239] media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes Date: Mon, 24 Jan 2022 19:41:55 +0100 Message-Id: <20220124183945.566055920@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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 96ab4b61669a3..36d50c3f9b08a 100644 --- a/drivers/media/platform/coda/imx-vdoa.c +++ b/drivers/media/platform/coda/imx-vdoa.c @@ -295,7 +295,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