Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp450255pxb; Thu, 9 Sep 2021 04:53:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsJXBV57b5lJH4yyuIvp3U/1nIIFeKQWSvWw4+/JdiM/Q16JEU8ixl5Z0OMPStqqz1WKcU X-Received: by 2002:a17:906:6b96:: with SMTP id l22mr3034208ejr.430.1631188390215; Thu, 09 Sep 2021 04:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188390; cv=none; d=google.com; s=arc-20160816; b=wOu7xB2a+B5+7WApJLtCF6nXIQKiJfQOmkpxaqEmYoaRidF+sXLelNDKMVQt3kisbz tCNBWJKXqq2sytOE/Mn01nrhKwZMBRhkurHSf2X2cfDJR4fBpT2F3k50fjger73fBU7m wTWejpIoBAk/zPvvWgBNkRszerTzcGnyh4OIZHaZNO6CF5iCDZAjUETdQVPCKMPcmO44 i7uKVKef1Cw+klJmWKu5ad2KKgv60FWhl39tSbG8fzZj3mVt6aXhIkE0ZuIsT8EXo/IR IcSx8mocAE6nDiGTjdt80wh+WSAGYhj3JiXICQlq1AB/Lwzvq1x9rshNcGRSQQ1mXMlC nv1A== 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=T1mWefe07l3okvGXt0QpqlYK5W2JXx07E1ZtNAYwats=; b=Ezu1hzyPsGkYN/dA5L49AuX+LAhSMFPFY/ck1/7edzY3dWz9N8+rzHK0ej/hWBufo2 FsVBG4N88hZg+X44LlFUY8P5J/nrue18I8dqLEeL1WO6Zu/N9jjHi+ipwJ30W4Hag7jD pPkBA2An5VXwhMMfnCA6VX9ZN0WpyaeE1evEMb6gM3q27RmTyDGmm7q7Ui6SF1AryW+u FqxKp2VhcQFufg61NDZHm9FnQJS7s9h3A5bI8LyRnQRiIAVa/VRF2DqGBua5fXsNBmMH MGHNojY2bd7vuCRdI1/BmzQoOqiVy11poBgRLOkKJbzRHX2qfRiaqNrDvlGDp5N5ahDk XRzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iG6rARMS; 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 v9si1553009eds.43.2021.09.09.04.52.43; Thu, 09 Sep 2021 04:53:10 -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=iG6rARMS; 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 S238762AbhIILwC (ORCPT + 99 others); Thu, 9 Sep 2021 07:52:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:54744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242198AbhIILse (ORCPT ); Thu, 9 Sep 2021 07:48:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 86B7D611C7; Thu, 9 Sep 2021 11:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187808; bh=Mgk6zcJV3cp/1FnKDc4HTUGsqHEyT0cD/bodCBNyz7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iG6rARMSQtBOWvymGnKcrEgjGkDxxLtw2IWBxaKqjTRjypaBCzaUYNkRtdvFssm5t ZJ6H9WMzy9QrZP6Ao0AOceb4v5OTMl0fyaFVCBjnrZ8VjyqwNC/ipWZmFBb0jm4VFs hm3oUdkWF8vfl1QzPsvCPwyU5EblzfQTr761iF5Qyh5Z7OnWjhjcEbsd/hzlt3ZW57 gk7wlv5xP3+pSJfYIpfvo2yoZ0mbyM/0nlZhO59YHkAKhGTljNkUB+aF2zT+qnbkBw Gl/ALdcTRmS5vJxQJoQcODsL60tE7QdEVmCYbVODqvoovZQkwT3oJwhaUItdm5Lqfh FARjaSvSYL0mg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Evgeny Novikov , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin , linux-tegra@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 110/252] media: tegra-cec: Handle errors of clk_prepare_enable() Date: Thu, 9 Sep 2021 07:38:44 -0400 Message-Id: <20210909114106.141462-110-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-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/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