Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp501781pxb; Thu, 9 Sep 2021 06:00:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/wPjqm2LBRo3olANS6Zjb7Kx9VQhf9v+33Eo/i38GE9F/H+qQJSzwBwPjWa2ADD+Qmshr X-Received: by 2002:a5e:c807:: with SMTP id y7mr2509674iol.87.1631192437386; Thu, 09 Sep 2021 06:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631192437; cv=none; d=google.com; s=arc-20160816; b=ztlITqlnSnQBGMdQ+Akw2opErAudUp6cNu90f4Frt/QF3h5hW/xm4ncbUhovQvSUtV VJwe2Gb7pMPREOoTUf+OPPIltyv/cEEbjLxONrF3oO9jQ3lexd2jBmzrCXbPTHsPvmoa B/2BLV/XCOmsdZ+OX8W6S3Jz2irpLCqJVoMLz685rAunEeqj/MW8dUMyfMcOweNPJnxK B1rymyRRxDnfdaI1+3bAPhM4ZDbVeRXBN4LolWd3+IYJle7kUnQUkJAf8Ipi0Oyde9XS yHsBkl8u2vDyzz+FpjE+9ErEJLH3LG+9tQj1e8zFYPT+2L7eavgty+FNUcDzW8NjEac9 2UEg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xG84xOuVYb0X1olPJrs74HZJHEGhVqRdMHTv0Dn1rIQ=; b=LvcwmXN/h2eKig9OQCiUlscIvhQCQtZ0dIMIWS2/M/nb0W4wG1RG+si9OFHdq+5/Yd kpSDbbVMpp53HYMNB0uVCl6y2t24KYPtqQjRIjdxMMiKcBouryf/NCifQtxazyqdsmNS eC587O8Vgadj/HSbXkboLaDXAIp9Y9DMGKK9e1cyIUvicFXXlSH1xt+w4ziPuBYXm7eC 0nEt2PG8AlPTUpa9VkpWJEcDTKILDJVKHxIA9i3+ukarY6Zyi2fTnraC3pm6mtv/V9q8 A7QlDzG7sQq+BWEtmvnPcjflet/084jsM8AKifC6Cbf+H6OEQ9m/7UGpqarOPwVw6VJ4 4d4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W+mUvfoG; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si2005221ill.70.2021.09.09.06.00.20; Thu, 09 Sep 2021 06:00:37 -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=@kernel.org header.s=k20201202 header.b=W+mUvfoG; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357124AbhIIM7i (ORCPT + 99 others); Thu, 9 Sep 2021 08:59:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:40848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353691AbhIIMrF (ORCPT ); Thu, 9 Sep 2021 08:47:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AD33563217; Thu, 9 Sep 2021 11:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188574; bh=zSV7DOOWFw3nSUmyFh+zYk2R/S1ll/DHgGt+nt/QXng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W+mUvfoGqshRSZVZ37KPwz4xf2+3KecnPNwhHQnquMwdT2x/DNIPTYR7vMyOWhpLO Ni33msmQuQadiptEZC8FTIDozTKd2qb2MoEALP0rQpW5ZrYaVgS4RDiyD79JIoyLV8 g/y08ubyxtsMPpBk/oI0wbK0A5G7Is4jrRNhaIJ4Xpm14YDqwJHc84rVYRajcNqz/u d6OgDUJTInOmdwUoxCXUUMZ1PXt9XwinuqaR8rDygyKqWnPG7PQhtMRBtLRdrmE59w 1lNk2O0WyoshQ+Ci5afVyZO+41kVpxSLp6RPX5F/v0Xmu7O03ss0D+izzx/IrMLnPn rHdmtQa5xuY0Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Evgeny Novikov , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 053/109] media: tegra-cec: Handle errors of clk_prepare_enable() Date: Thu, 9 Sep 2021 07:54:10 -0400 Message-Id: <20210909115507.147917-53-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115507.147917-1-sashal@kernel.org> References: <20210909115507.147917-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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/platform/tegra-cec/tegra_cec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/tegra-cec/tegra_cec.c b/drivers/media/platform/tegra-cec/tegra_cec.c index a632602131f2..efb80a78d2fa 100644 --- a/drivers/media/platform/tegra-cec/tegra_cec.c +++ b/drivers/media/platform/tegra-cec/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