Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1232008pxa; Thu, 20 Aug 2020 06:18:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4cf7dupjiuJBbAdge7O+pANNRmYOh8qHbCBGywrhKCq45ZP/fzz92W5RyPtSj3TFuyFDe X-Received: by 2002:a50:c905:: with SMTP id o5mr2031605edh.343.1597929488667; Thu, 20 Aug 2020 06:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597929488; cv=none; d=google.com; s=arc-20160816; b=LCUjoo/xY3bLNZuojRAoa0pmGTmUI0taS6l7h0voyoGfiswZjCrJc5lA7drXA3CscT lXIZ/0anlNyadqEOERbTDyn+Jdd1LOidFny0wR+xkFFmxY7nM9yUJ6aYUliKnSIsWyq4 xhpEXZufPfiIw3eEJk2ipY4es0Eo/LbXaCl5VvllqPm+koy+G2+cqgY92ywixWZavDac 5dLT9c8rFfaAUsh13AaoNTN0QeWgqWAX12LszpkPbwS46dtibAX7WPPJEEqVo16Qstt8 qy4FzotnpuTp3IPmDp4kZS2750RteSVpnjG3OGtCD70RKMKka09ypy6kRfrfHQE5B5YG t8OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2vZW8c+1Q2gQ1xSqqL/01pHHFZOWbTlH9XlaV7K721E=; b=W1vR1wojM3if46JYUwjNF8DePxI6eqPmnODUKSTeOVG1uH3P3X7gLWgqBx/HGcGZ09 KnqmlSQDBbLw4w0hil0dIlgjSiu3UnN66iI2LhGELgh0GLB6CKycRaQq08PXvgRoWWWK J6RPrHYPCjQisaOGjxwRBDMRKbHKkY5RHHUzJy3fLEpYVTGP/TPnlIdzY/G86PK7DlCz M7Icicq6PDU2shlWC84QdfREofuz+C40sVX5lcJdf8LTqyQIyswxvWs3Lo9IcT3yoc3U uZmGHoZS/jXyJQuD0amU6jqjI6kXyQSYV2fFCrT9+x4QLQ5PJKEMKsFJ+0IkdB68cxIu +IoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="1k6/eG/g"; 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=fail (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 z1si1220835eja.41.2020.08.20.06.17.43; Thu, 20 Aug 2020 06:18:08 -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=default header.b="1k6/eG/g"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728492AbgHTJfM (ORCPT + 99 others); Thu, 20 Aug 2020 05:35:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:42980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728216AbgHTJbQ (ORCPT ); Thu, 20 Aug 2020 05:31:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5DDD21775; Thu, 20 Aug 2020 09:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915876; bh=eevjQnw9rouQmoVAWrlOyJAU3VncyMN6KmHNuM6x0uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1k6/eG/g3LaOi6gF2rj9BHegFRSTz+8RIGDQtkabR84vt48NCjzcXYrZC/kPslAg0 gkB0SkfNrrbKE2FM5z4buyphRXc12Sflcc8fmY0kOLgiJw1+NQradPXNkn44BbcCI1 SMQxVYgqt/zreX/k7+viY7c4d47f0W+WDKem1iiA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xu Wang , Barry Song , Stephen Boyd , Sasha Levin Subject: [PATCH 5.8 166/232] clk: clk-atlas6: fix return value check in atlas6_clk_init() Date: Thu, 20 Aug 2020 11:20:17 +0200 Message-Id: <20200820091620.854473044@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Wang [ Upstream commit 12b90b40854a8461a02ef19f6f4474cc88d64b66 ] In case of error, the function clk_register() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Xu Wang Link: https://lore.kernel.org/r/20200713032143.21362-1-vulab@iscas.ac.cn Acked-by: Barry Song Fixes: 7bf21bc81f28 ("clk: sirf: re-arch to make the codes support both prima2 and atlas6") Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/sirf/clk-atlas6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/sirf/clk-atlas6.c b/drivers/clk/sirf/clk-atlas6.c index c84d5bab7ac28..b95483bb6a5ec 100644 --- a/drivers/clk/sirf/clk-atlas6.c +++ b/drivers/clk/sirf/clk-atlas6.c @@ -135,7 +135,7 @@ static void __init atlas6_clk_init(struct device_node *np) for (i = pll1; i < maxclk; i++) { atlas6_clks[i] = clk_register(NULL, atlas6_clk_hw_array[i]); - BUG_ON(!atlas6_clks[i]); + BUG_ON(IS_ERR(atlas6_clks[i])); } clk_register_clkdev(atlas6_clks[cpu], NULL, "cpu"); clk_register_clkdev(atlas6_clks[io], NULL, "io"); -- 2.25.1