Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1941226pxb; Thu, 16 Sep 2021 21:02:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziH+7jZ1o1KQ+d1fIEMgahqCuwBm5vA+9eGZlg7fr3RNOIqY9hHz+8XKZAmXZvcGjt1lH2 X-Received: by 2002:a17:906:8295:: with SMTP id h21mr6508254ejx.101.1631851338659; Thu, 16 Sep 2021 21:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631851338; cv=none; d=google.com; s=arc-20160816; b=a+YPelIulPGEhozXGIX+m7mcd/1zT0vALPSQUeetwj8xS8E/Zl4gmURHukC82UvQem GKIpVkRTSgM/sZdwZ8YJj4vzsV96OmVUEAQiD3BA5mkUeuCxtBKXt56M6elSmqwkmGJJ QNK50lpN30xee0ouxu5ZtNevEp8MeYi+BTLbi7X1CUzI3RkEoHLkf21oMe4xo6oawWJj Ck8Hb4pGIGx3D6LmAABceYqUi/ay1nXaVCWFJddb9g/LinC1OL2Pn+b0YCpISUybGEM0 xETsYod2Lh5OaMyKV/OAVsUJxs5tvP0vew6lOzs9cQyPUDuNRlmN0SEtaraHlLrTMQDQ Z9xQ== 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=ZAKOMhThXOQUQCtWAhQ5NeGF8B0pJwxzYTXBZCzppYLgXRpCifbYt1Hd1jgxfz6c2S WRu97nFooO6lyivQyoIhub3O2DKzoK/DnsxM8JW7QkieYbR//6MMebhD9W8xou06udmn FGbVrd8S7uBIpP+7wZrGGvj045oHVZ/RMF1D1FOTkO+MFZbEuriiyVXu338F/w/GgkcD 4UUe9pWVwCFliOPJ26dN4CkGLm7Zz2HALsGVGGHzsDTXC0ZlW74KpWSCGRchhknplUW7 tkyp7VqgIH+M0ROWrHsts98B7GgMU6F3FY2s6gT/ZRGw7ffT8DzMzCec4KmtiLRUhymQ LSIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NZzVEtp3; 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 bi16si6277143edb.381.2021.09.16.21.01.47; Thu, 16 Sep 2021 21:02:18 -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=NZzVEtp3; 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 S245528AbhIPRiW (ORCPT + 99 others); Thu, 16 Sep 2021 13:38:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:47078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352832AbhIPR25 (ORCPT ); Thu, 16 Sep 2021 13:28:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 61E3961CF1; Thu, 16 Sep 2021 16:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810767; bh=Mgk6zcJV3cp/1FnKDc4HTUGsqHEyT0cD/bodCBNyz7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NZzVEtp3zxV9HF37hYZ3icSweVdfIzZvjdhuRc2d0MG3tet2fNDz7qcOkzjcyAYTq sPddF7DOQSWxBjd/alsx04e/R3hStLo1TeRYOIItSy60HZtx43+xhDyRTHYZjcCMIh CkRA4TnHzJzZ9HR3k8uCKzt/Rb44G3qe6Grjgzrs= 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.14 260/432] media: tegra-cec: Handle errors of clk_prepare_enable() Date: Thu, 16 Sep 2021 18:00:09 +0200 Message-Id: <20210916155819.636415957@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@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