Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4610605pxj; Wed, 12 May 2021 09:12:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXszgzuCVql/HFOqSCgwNW+rq+An1MIcpGY23+uTybh3c2c2H1wmB0rie0gJoC6rotj0PC X-Received: by 2002:aa7:cb84:: with SMTP id r4mr44267065edt.187.1620835926525; Wed, 12 May 2021 09:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835926; cv=none; d=google.com; s=arc-20160816; b=qHflnP54sFdCArRXECKFR1ZWgNc+OzhaijOPZdu9Yx247loJetEBBpskEBzqc0o1fv pPL3ANKS6PMrQWHzG4w+9NbVKkwKc4Qhm+GxTi7eoE2kQaWyvfzmHTkvoclZC++UL63C p/2JSSCPFJs/DWxgWgh9NvNQnh6BHGBDphUvJZ/ExYzXKxG0+GuPWfd6O+39VCTw+ehs lGcU4wrEDxZsWUhkv6+p5+Hx9C9/NaPMS3ANELPcr/9yrhjV3+4yzuMbIlSGVwuGPAJl XIAIu7wBpFdBiLOTTJ80A8Bh4g7HZWThdxwA11tLoWlVpaZ03sQe4r9PeeRkArnKjvSR iY6g== 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=CMGfnyxdLwHPflSLSIp+DRD6q1hzbc8AgBSmq6erMeE=; b=epxAsoluQ3ocZgxxixNhzA2kgm3DpdhFFo3l2B4xGOWGqHyMjbAn/71HhUoohzVp9/ qIlY3yXp1hRKfcblkHtMi6wfa1N95LIU5xPoCQgqK0NQkDCYAaA/V2ksCh4V+cu0Bsnm aCD+ZGpNS5b3SV8IzECctL+dQ9TZvRxuhyu+ZahvvyY8p/m4ml68XQ7Jyp/z1Cv1PudW 4szJsTrGaK/6tP7hGzTJLcqQcaP36a9QLW99ZiGd28TltFufPRFKdeUwI5MXmEJGbw1r 2haOx3TCAejHHyAgG/Md2j+mFUR3z/jcDGHLYofz8kTZ5whVZodHbNzy5WYMFpG81OBY vWPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iBVmYKfO; 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 z5si110958ede.44.2021.05.12.09.11.41; Wed, 12 May 2021 09:12:06 -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=iBVmYKfO; 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 S238492AbhELQFQ (ORCPT + 99 others); Wed, 12 May 2021 12:05:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:38716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235599AbhELP2h (ORCPT ); Wed, 12 May 2021 11:28:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24F1761C29; Wed, 12 May 2021 15:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832449; bh=7XwtRKaT9fbjGtJQVoWtOUiOvNV40pTl1acFZTm8aQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iBVmYKfONLMS93rzpehaSOKVKHAWJ5xgFi89EmFkPyGX0xVC83t567quPC97wz7Nq clHZE+BDCVAKQMp2r9QriTCCBW2VX0Nq1o3IFG/vxLI0l+IaA5Q8GUc84eG3jQ4tTt aOv/VsCkqwQkZgVIgnvo781fnVzP3WTLvAWMKFwE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Lukasz Luba , Sasha Levin Subject: [PATCH 5.10 257/530] memory: samsung: exynos5422-dmc: handle clk_set_parent() failure Date: Wed, 12 May 2021 16:46:07 +0200 Message-Id: <20210512144828.280053266@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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: Krzysztof Kozlowski [ Upstream commit 132c17c3ff878c7beaba51bdd275d5cc654c0e33 ] clk_set_parent() can fail and ignoring such case could lead to invalid clock setup for given frequency. Addresses-Coverity: Unchecked return value Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Luba Link: https://lore.kernel.org/r/20210407154535.70756-1-krzysztof.kozlowski@canonical.com Signed-off-by: Sasha Levin --- drivers/memory/samsung/exynos5422-dmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c index c5ee4121a4d2..3d230f07eaf2 100644 --- a/drivers/memory/samsung/exynos5422-dmc.c +++ b/drivers/memory/samsung/exynos5422-dmc.c @@ -1298,7 +1298,9 @@ static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc) dmc->curr_volt = target_volt; - clk_set_parent(dmc->mout_mx_mspll_ccore, dmc->mout_spll); + ret = clk_set_parent(dmc->mout_mx_mspll_ccore, dmc->mout_spll); + if (ret) + return ret; clk_prepare_enable(dmc->fout_bpll); clk_prepare_enable(dmc->mout_bpll); -- 2.30.2