Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp612724pxb; Tue, 5 Apr 2022 15:58:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8R7u7E8ZczECxmioKLmHSQMKePzqrLLKD2j/9XNd7pwOtZhKABbYFhVL4IA8inr/NTPMx X-Received: by 2002:a63:574d:0:b0:386:c67:b383 with SMTP id h13-20020a63574d000000b003860c67b383mr4677979pgm.324.1649199513295; Tue, 05 Apr 2022 15:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649199513; cv=none; d=google.com; s=arc-20160816; b=Qlmz1EBU7cVmPDLUIyn7RBSayYvRahvC9KLsnEtBBXzIM7H3tQpa+tVffHcNK+akqk ftKyR2wuP9BdqDMsNeITeVqekCqwiwFvMbv4HQdlr9ITASs+gP11v2SKIl56aEgrxu60 CQvjqiMLbDJiR5lJS2VYDrOcEmHY8tqSv21VAiBdMHcFJ6VYxvqQQv0obfgzbw/VItxa 0atQMkcnIc+VLD8B2jlP1PhIH6Wzzqb79GdsdMaMc1u7EyQ2z+BvZtDPb6IQq6ZNUS4X 6bkVoRYSko6mfsUQSUMxw27rpYZIrZ/P0BFePPmXge+l8mdO6C4RMnSjnlTV6QAQycQ4 kb0w== 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=bomaihAV+vsKj6JdBSJGfHOAqnxRGC2Y0CXEYI6eFHlN+VKDzP3vF3z1s1ANJUbB82 HkEtH3JVA1eLtcFo3nfw/o9XwiPR+boCMSlB2vPKJ4Z0fcU1xm0m3Rm7FqcG/rW3eUsg ME9W9Uj2nEbP6AQMhWok3909TCKzPY66F6P8r69kO6voz3Nx/OiQBfnkvQh2m8yzhkMQ G26OkHlAX+xzkXBoG0q8ONlSxCHYP+wvfh4FzKek/IWGltpIhftHL4uPtfOVB341kAOX WwvmsGEg5cGJVMFgqOVwFg+66yCd6QZLfvxDcRsSnFS1gd0aspLzedC1H5dBghTEZviS DngA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=InYYuFxX; 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 i3-20020a170902c94300b001540b7dcf5bsi15773167pla.498.2022.04.05.15.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 15:58:33 -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=InYYuFxX; 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 56A9D27155; Tue, 5 Apr 2022 15:39:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239454AbiDEPFz (ORCPT + 99 others); Tue, 5 Apr 2022 11:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345351AbiDEJnY (ORCPT ); Tue, 5 Apr 2022 05:43:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A9D0C3345; Tue, 5 Apr 2022 02:28:53 -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 ams.source.kernel.org (Postfix) with ESMTPS id A1B4AB81CAD; Tue, 5 Apr 2022 09:28:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFF50C385A0; Tue, 5 Apr 2022 09:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150930; bh=DgaIpDFEc+A61h9xhkJGjlT1kiDaci5Wzlmlp8QsmaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=InYYuFxXxrm4WjZIemceQyj/RLWV8glgLOB9BFbYwkhkAefnjsFASiXAgxCGoEuGR 8WKN0Ys/rv1IHyFw0t/2yE2tb+jKwAO5MBbD7kuH8aMPuwfBclOPztuXN08oO6+VJ3 Ds3xGHzVtBQ5qVipFOV2aYn1rYgodnBGDxyA3wXM= 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.15 232/913] clocksource/drivers/timer-of: Check return value of of_iomap in timer_of_base_init() Date: Tue, 5 Apr 2022 09:21:34 +0200 Message-Id: <20220405070346.810433611@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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