Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp715497pxb; Tue, 5 Apr 2022 20:02:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyG/w8rn6LtdpOtye0EJhrTcyqXdI7UVjjPt5O5MlLZotBPPBW3fDTnDGcQ63P7LBpr5n+ X-Received: by 2002:a17:902:bb8d:b0:156:51a1:3f5a with SMTP id m13-20020a170902bb8d00b0015651a13f5amr6412933pls.65.1649214149965; Tue, 05 Apr 2022 20:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649214149; cv=none; d=google.com; s=arc-20160816; b=yb/Y+7IlJQ1di/IfMsxIxwq1rNOWSsddpzsdoE/bwk9fPhkgaUUWzqoewLYF6d1dwL dvd0nfJPFEcfrj2YABDJigFC3nfhp1kFquEnhjVcXcdF+Edft5LAJHDtEkdUP6z5GvCC TFbrV2ZrUabGXVq17yyvFWp755/sWSHDTWGjq36qRd0xbpHf1QS1xAx6M5VFOmRmHzjc Gex1YyI06w9Nw6NY7SLGX3utJNxtFx+UBTZ6DLBSiy5a2J0WZF8Bmuq1PpfCfoMy2tWn lsRika8lTypj1HdnAr7yxzmAv4cK3gjHGB9g80C2FD7mh6L0O7RXmfm86jTR9Q6+v7I7 3jrg== 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=pTSMQae2VEmmDvEuYn3HKriL4xfAKGaoOZ8nfddQ/1I=; b=gu181taBgl6AcWZd3dGpGLp8kRVrS9/lRupbxxN5rAtT0rbncUprFqcSwe8cSCRl/j 3GzyFi3bH+C5S8mQMEUquD4V/dxakKRbXUXZ6V/mcAFL9Vk2AUZXGLfK62Bi/DyQ6N6f vELDwitQBZYMpyNXdn1tLkt836u1emfxPg98ANcc873+SbiH2GhoUGERFrAu6MgWURD8 ZEnRSVDUMlKo+OPgfKY+4UckaR1YP9L/IDbWcG++amo9jDsNFp6aSOVBfx8/HN8BIqZz EunZ7qAlR9q19HdiVzniKdHaEIugefLtL68HF0zGuOWoBIaq3MSp3TGER8R0l+4lrW5q 1t/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FqrdWFCy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s13-20020a170902ea0d00b00156a03969e8si8372331plg.307.2022.04.05.20.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 20:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FqrdWFCy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3C3495BE64; Tue, 5 Apr 2022 19:47:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378645AbiDELhx (ORCPT + 99 others); Tue, 5 Apr 2022 07:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244699AbiDEIwe (ORCPT ); Tue, 5 Apr 2022 04:52:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82D93D95EE; Tue, 5 Apr 2022 01:42:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A33660FFC; Tue, 5 Apr 2022 08:42:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28440C385A0; Tue, 5 Apr 2022 08:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148130; bh=DgaIpDFEc+A61h9xhkJGjlT1kiDaci5Wzlmlp8QsmaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FqrdWFCycC69SkEUx0vT9++OclVZ/cpTAAAvBAdz3UTAxUhTVrBqN6Sfw/9oeOlQE +B9C8Ei8hjKf4j8F01VkhkigAZ7QxR22FCWRMiQBLchSDR8mcAx2mzeRLdf0kVIbM7 7VL4ZF8P5G2kLnq12geh+JHAJotEkIPf77tulBX0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guillaume Ranquet , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.16 0245/1017] clocksource/drivers/timer-of: Check return value of of_iomap in timer_of_base_init() Date: Tue, 5 Apr 2022 09:19:18 +0200 Message-Id: <20220405070401.531298031@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guillaume Ranquet [ Upstream commit 4467b8bad2401794fb89a0268c8c8257180bf60f ] of_base->base can either be iomapped using of_io_request_and_map() or of_iomap() depending whether or not an of_base->name has been set. Thus check of_base->base against NULL as of_iomap() does not return a PTR_ERR() in case of error. Fixes: 9aea417afa6b ("clocksource/drivers/timer-of: Don't request the resource by name") Signed-off-by: Guillaume Ranquet Link: https://lore.kernel.org/r/20220307172656.4836-1-granquet@baylibre.com Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- drivers/clocksource/timer-of.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index 529cc6a51cdb..c3f54d9912be 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -157,9 +157,9 @@ static __init int timer_of_base_init(struct device_node *np, of_base->base = of_base->name ? of_io_request_and_map(np, of_base->index, of_base->name) : of_iomap(np, of_base->index); - if (IS_ERR(of_base->base)) { - pr_err("Failed to iomap (%s)\n", of_base->name); - return PTR_ERR(of_base->base); + if (IS_ERR_OR_NULL(of_base->base)) { + pr_err("Failed to iomap (%s:%s)\n", np->name, of_base->name); + return of_base->base ? PTR_ERR(of_base->base) : -ENOMEM; } return 0; -- 2.34.1