Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1733284pxb; Thu, 16 Sep 2021 14:16:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdbmgd4Bwzpfmc7l8+0JCjsKnsPWrhfjg+qEKN81NoBWu+SKCb37jYlGkauOzIoUgQvGgR X-Received: by 2002:a6b:e616:: with SMTP id g22mr5941216ioh.67.1631826994602; Thu, 16 Sep 2021 14:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631826994; cv=none; d=google.com; s=arc-20160816; b=CPOvv+DOwbRlzPsdxpIVSzwR6UeWT0w8y0gekb+1CcoEbbrrODlYtZCzFvq/o6RgIl 6malCsoVMGRecqJfDer/l5IpoYuERDCFjDguh3t3nxuwwjsFMkmkz6qDYlmjRuhRdNcH fp2n+2/xiaGSt8TjeI/5XPMcLagJmTatA9fYZiVH63NrozxYygjj7YfAbdmWSfS0Pg6Z ohYZ577mkNyZMv4WpE0NuS9KNcdFbfWb4k8VroxZUPsOSWkeqPrLtk2tF4xwip5QkBr7 6ZgC0w8QdoHmtG0CJak8IB670ifMYuihK6C1iOlMyKeVdiDZcTH9QeLmXXvY2gd5x1o5 Guaw== 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=T1mWefe07l3okvGXt0QpqlYK5W2JXx07E1ZtNAYwats=; b=ceJM+PRfWJR0Z87mDWPZXjoo4Iin9OQaIJd1aWK9UpVge6aMYZcgnpZDmQ3JRBEwDI BhtqBc1tYO2a0iW2zeybmoOjKkphgUczMRhBqLTUFkrHYXyFp0/3ydNmYKUHt+SYn6+S Zdm9vDQonmORb6pbz2yJ+dOgxZRABnK41w66YBhIyvIJ2aHnP2S8C3d1DgWCfYGDWTTJ VWf4tzi/bBGSFUWXDT/+G8uNdHjAxkTPQ3RXGBiRqsUkJa1Wc+fiTzLbIuGyMkGUIoc2 KfC2/DcoNiekiyEVIH+otnYkVvzUgeRYOp90UvO3Sp0DklMK5GF8U8iFzw/EU6zfgfY/ 1QGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="00KzxR//"; 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 a10si4190243iow.65.2021.09.16.14.16.19; Thu, 16 Sep 2021 14:16:34 -0700 (PDT) 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="00KzxR//"; 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 S241810AbhIPQ2F (ORCPT + 99 others); Thu, 16 Sep 2021 12:28:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:55354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236927AbhIPQSa (ORCPT ); Thu, 16 Sep 2021 12:18:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F876613CD; Thu, 16 Sep 2021 16:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808769; bh=Mgk6zcJV3cp/1FnKDc4HTUGsqHEyT0cD/bodCBNyz7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=00KzxR//zt1/jyeBFO8/AcwEO8pM7g7mKi9KPwbvhbL+AZ4ISVPN3fDdjRNHYJivq fn+R0iBoJ20I2B+s5Kh5YvPLALbBTku69AjMwE1yGgHVSuUAjrrQ3GEsdJImlfT1MH Eee1fqgsIDBn3MH64DXRsY2vSOKM8a0y6QFq/q+c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evgeny Novikov , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 183/306] media: tegra-cec: Handle errors of clk_prepare_enable() Date: Thu, 16 Sep 2021 17:58:48 +0200 Message-Id: <20210916155800.320804646@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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: Evgeny Novikov [ Upstream commit 38367073c796a37a61549b1f66a71b3adb03802d ] tegra_cec_probe() and tegra_cec_resume() ignored possible errors of clk_prepare_enable(). The patch fixes this. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/cec/platform/tegra/tegra_cec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/tegra/tegra_cec.c b/drivers/media/cec/platform/tegra/tegra_cec.c index 1ac0c70a5981..5e907395ca2e 100644 --- a/drivers/media/cec/platform/tegra/tegra_cec.c +++ b/drivers/media/cec/platform/tegra/tegra_cec.c @@ -366,7 +366,11 @@ static int tegra_cec_probe(struct platform_device *pdev) return -ENOENT; } - clk_prepare_enable(cec->clk); + ret = clk_prepare_enable(cec->clk); + if (ret) { + dev_err(&pdev->dev, "Unable to prepare clock for CEC\n"); + return ret; + } /* set context info. */ cec->dev = &pdev->dev; @@ -446,9 +450,7 @@ static int tegra_cec_resume(struct platform_device *pdev) dev_notice(&pdev->dev, "Resuming\n"); - clk_prepare_enable(cec->clk); - - return 0; + return clk_prepare_enable(cec->clk); } #endif -- 2.30.2