Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2525770rwb; Mon, 3 Oct 2022 01:58:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4R9RKQ5X3lepaXfDUfTHTXRy04YdcDOk9J1TwxkASd7zUznBZQBXpYHQiT60uAMFiwwuQN X-Received: by 2002:a17:90b:1894:b0:200:b12e:9db0 with SMTP id mn20-20020a17090b189400b00200b12e9db0mr10886105pjb.219.1664787502840; Mon, 03 Oct 2022 01:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664787502; cv=none; d=google.com; s=arc-20160816; b=qEk1RnUUbygP9+UxtZxFYkqvgvVl0qpARe8AUb+Krx9sjqeQwXNTYghY2YLjWQz6qi 3foqb/BjMXeCTaI/Oc1DxW620LqSbeXJNPON+2AL5E3U+2TSkgJ8Q2dbllV8lGWnx7w0 cZ6UtzzN2jldF9yS4JcUW0+sIa/VrGKLTtNeWt8sC1aTGpKu/w+r5hQsgSdGeLvYruFf R0MHvbiK00G7dObGNZCcOIjfTADP91o2eYlhwbk6O+AanycPPLOMH4fS7dep9DqJa9rq rXQfDJsZjhUxkJZCbl8Ys4jgP4D6AxGjd/dENG16SJUwkytyc0g9DLiR6wUDcWzuSQSa zvxg== 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=PnbwX06Y2e0q5Pxj3TD3/H0TNvnY2cjVLLMghcUOTMc=; b=fqxj1R1uYOzOIW2aTUy1XgKJEDH7CwlQSzJK4jn1v6nzKgLQrJlSfBWFXaWa/rlBg5 2hk0jsXSpfD2zWjug7eBo2H2KyhTA+ZfDb9kbjX/ug37jd6cEj5s0kWYAhcelQm5QcaL ahBmW+aqk44F4A12NdSX5KFZ3BxLBF3dN2KHJyyKZ9TaKYjzo/OoMgSnBy4vxz/U06Y4 7YW60bhxZ/+QmelZUFS7AwBSJCTdjtwfs4y8igcRIvpklDBM8NJKhtyNHVMzaZLZMvQ9 1QwfgW6Za7jtC61X93NEfElS6vPdw8S3DQQMcEJpIM/oVW8YOstO+IOBLP2NUp84QV8/ Detw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LssQyxtN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu6-20020a17090b388600b00205593e76e8si14937254pjb.81.2022.10.03.01.58.11; Mon, 03 Oct 2022 01:58:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LssQyxtN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231582AbiJCHfl (ORCPT + 99 others); Mon, 3 Oct 2022 03:35:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231777AbiJCHe1 (ORCPT ); Mon, 3 Oct 2022 03:34:27 -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 1E82F52DFA; Mon, 3 Oct 2022 00:22:04 -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 646DE60FB1; Mon, 3 Oct 2022 07:19:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A7FEC433C1; Mon, 3 Oct 2022 07:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664781593; bh=CcH2+5JFR4arTN14uAOW6GMbpSYm3V+PJ+UNMQhMOaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LssQyxtNBPY80V2RHBYJ2XuLgUjRUH6p2z9dqOV9HDJxH8efAUcAC8CIaf3MCgWZ+ 0jGFDUsLXSPKG3qH810HqY25L2rLMdZtTdQEshnuttjjWC4hcVHPq6Ut/zFTJWcH7p VToaR1FvTnkmu/LtBFsuKShhGg+hoyvgtm3cyonQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Wu , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 59/83] net/mlxbf_gige: Fix an IS_ERR() vs NULL bug in mlxbf_gige_mdio_probe Date: Mon, 3 Oct 2022 09:11:24 +0200 Message-Id: <20221003070723.482132748@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221003070721.971297651@linuxfoundation.org> References: <20221003070721.971297651@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: Peng Wu [ Upstream commit 4774db8dfc6a2e6649920ebb2fc8e2f062c2080d ] The devm_ioremap() function returns NULL on error, it doesn't return error pointers. Fixes: 3a1a274e933f ("mlxbf_gige: compute MDIO period based on i1clk") Signed-off-by: Peng Wu Link: https://lore.kernel.org/r/20220923023640.116057-1-wupeng58@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c index caa4380ada13..5819584345ab 100644 --- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c +++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c @@ -244,8 +244,8 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) } priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); - if (IS_ERR(priv->clk_io)) - return PTR_ERR(priv->clk_io); + if (!priv->clk_io) + return -ENOMEM; mlxbf_gige_mdio_cfg(priv); -- 2.35.1