Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2565488lkm; Mon, 20 Sep 2021 18:51:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG6VZtgQYsZ3B7wLbqgnpk/62rQb7Zc0cSSNMmgpW83lCpvyuELt/T199Gzt3J1BrsfTn/ X-Received: by 2002:a5d:9949:: with SMTP id v9mr8287077ios.58.1632189002552; Mon, 20 Sep 2021 18:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632189002; cv=none; d=google.com; s=arc-20160816; b=iZT8nNkp6ayIrCZ3s3tQ2AZ59qSaQ4+j1KJDFxBatVnUYy/YzxLPmVB225ZK93Xjw8 0KPzAf5xyo41dE9ClPHaPWVMT6Jn18VnWD+TxHYfqa9VzbtVzTJ5AAtbPoSElCNaHqLA ZYYILvdrqPwppG/sZkY+0h1Co32rMfSg3mysj9EqoExBkZRpNoEz5+hSnM3e4/eHP/Rm XqDM14BL7yTz+HNqpCLDJ4gKdnnD0ZvtVglePk1CIqG5Wf9Gr7+ZTGSbkuGYaVZ+8C7O vBvoEbuu1rp3xqW7KsrXAh7yPcMz/yoNPg+r27FrkC5PGsIvychgvDkc46RWBeLXDodL NFKg== 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=vkBQ4yi1/7jN/wzGpk8ayR278l5hiadoSct5j7sR5b4=; b=tqSFZOzCrHnGulxCUbUOHXN3gOnJCjIMucP/nSsLdoeJhzzJAU5E5E/fMYxefojeub PaQOyfOP/C7ps5dp3CUF4FnIeHQzrp2yNZCw4mnEeFMH4RfuUhHJz1ht/iA/C1ReGBTP dUKy9LgmSVIRMnwPw6xwc61B0mDLrhZ1a9F3zoLDopdXweAe/ikMZYbMC4EkFp5XZWLN bfabjJFuMoZR0rlWVN/ZwKr6b9GRaPyZbQWh8XL2s8EYDK4eLlrX7U4KE66HycoVMe7U LlBIjl4BrjjA9rzL6LlJ5c65FcvZgaNigzsclBk36vMVznhd2OshmXLaBNQO0vmEK+pd QO7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kEbxxLUS; 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 l20si579149jad.72.2021.09.20.18.49.51; Mon, 20 Sep 2021 18:50:02 -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=kEbxxLUS; 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 S1356707AbhITSBG (ORCPT + 99 others); Mon, 20 Sep 2021 14:01:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355067AbhITRwj (ORCPT ); Mon, 20 Sep 2021 13:52:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 667DE61BF3; Mon, 20 Sep 2021 17:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157974; bh=bbwQ7qaaek0b1eGHS5zbSzr0sQq1cumGAQxaFHr5mcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kEbxxLUSJbCrsfZxWuek6B5y5Fqw++H+jlIZt1PXiv53vQTAEI8ry+cQ5aEiFSUqo 4KCvCz1QEMG8caCDfGCj8WzQbhU3sJWNnextuB7mc0ixzbJd5NE9HvBSsehsVbn1Cb BUIh2SRZ4pq8udCumtIUEdUxm0HRyEIsSzxQ31m8= 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 4.19 210/293] media: tegra-cec: Handle errors of clk_prepare_enable() Date: Mon, 20 Sep 2021 18:42:52 +0200 Message-Id: <20210920163940.461021383@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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/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 aba488cd0e64..a2c20ca799c4 100644 --- a/drivers/media/platform/tegra-cec/tegra_cec.c +++ b/drivers/media/platform/tegra-cec/tegra_cec.c @@ -383,7 +383,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; @@ -462,9 +466,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