Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3055620pxp; Mon, 14 Mar 2022 09:55:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4XTPYalxEZkJBUKw6yzGEn9IMrI0h88X6NsJ0OTCSLbdzH0vYsnwUAwuWogxipYyCGlsj X-Received: by 2002:a62:643:0:b0:4f7:2b29:159a with SMTP id 64-20020a620643000000b004f72b29159amr24603384pfg.16.1647276917664; Mon, 14 Mar 2022 09:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647276917; cv=none; d=google.com; s=arc-20160816; b=iyMlBpA9z9VhVCpFYOMxmeVpNDPFjauaA6oOsgUMfi75dncyRWyjNi4+OcAGHufVCj eS2OEOjMcILNqc8ct8xqbBmmKfC4oeuTsezoYMVDiAG7rw7v1JBiAPvH+PV4iAcnFiXw LlK8D0Q7TFPp6lSs4IZdF+wNlMd0lATP9Ui1DSArb47W6IbNVC9sF1YuqDTUGw8vImsa CS1FNZnYvCpXCNCOmvq9kJQhkGySZ5KPMrtb+7mSclmzz9jHtlr3W+DoDWmcgoIY2kdI 2HznoercfjDMf623SqYLUHFpZwG2sUKSP7rJuBt6Q+3V2Ue+ftiHef2PFO9Y2JJ4JlqY yIfQ== 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=LJTX8QD8AAY3mk+HPtmvUNbI+VGEso02kDJmBxx8wNI=; b=BY6FqpixtJzyKhGTAWa0stiN+xF8lDMotdUzDw/G7uJWg40IqppYASDpoqiXjf8BmA mC3y0AxVQmVRKMsgrGGBsHBnCRcgMukjkf6dwj0FLYIEHPGjgOi3PG7KTlz2y1eRzbsT mbW9DO/VorGsdafehRgsXAKsIGGNLQXlqHj1oKCKJRQTBTOKsGyV2NHWpNAAOslanfLx WU0Hgi3zV31trPPLMdFy3IJqlMTkuKcnaJ2K2ET1NBudnJsKN8dSIA/K2QhUMLRHiCpO RQm/Ny2rqmAF0WpiNsvEuUDc13MrBR0zltt4lSfFXN9B1jgg/4BkfALXF/5Dcl/aa5YX 38+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2t8wyQls; 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 j9-20020a056a00130900b004f777b51012si12997106pfu.306.2022.03.14.09.54.54; Mon, 14 Mar 2022 09:55:17 -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=2t8wyQls; 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 S239241AbiCNLli (ORCPT + 99 others); Mon, 14 Mar 2022 07:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239259AbiCNLlU (ORCPT ); Mon, 14 Mar 2022 07:41:20 -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 9518549683; Mon, 14 Mar 2022 04:39: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 03CC761130; Mon, 14 Mar 2022 11:39:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC878C340EC; Mon, 14 Mar 2022 11:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647257943; bh=FvaAcrh3CRXnvv0gw1cYKnnHim79vbLSJegrEr3zwZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2t8wyQlsguE219KJ1jw1ZvmGMZJc7RWQjHftpf4ethStNN2UZIaNXEZZf8MU9CcPn mRLJXwamrRDO0MK7QHxrtL/XwceJ8bhP/j+H6PP9zv6otow3HAFEplmJQ/4IBsCVeb BgqY80FTZhdNEdDqjss+INDDtQBu1jeoB7/FD0j8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 05/30] net: ethernet: lpc_eth: Handle error for clk_enable Date: Mon, 14 Mar 2022 12:34:23 +0100 Message-Id: <20220314112731.941114908@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112731.785042288@linuxfoundation.org> References: <20220314112731.785042288@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=-8.6 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,T_SCC_BODY_TEXT_LINE 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: Jiasheng Jiang [ Upstream commit 2169b79258c8be803d2595d6456b1e77129fe154 ] As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: b7370112f519 ("lpc32xx: Added ethernet driver") Signed-off-by: Jiasheng Jiang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/nxp/lpc_eth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 415ac33341c5..27c22f0e9d25 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1512,6 +1512,7 @@ static int lpc_eth_drv_resume(struct platform_device *pdev) { struct net_device *ndev = platform_get_drvdata(pdev); struct netdata_local *pldat; + int ret; if (device_may_wakeup(&pdev->dev)) disable_irq_wake(ndev->irq); @@ -1521,7 +1522,9 @@ static int lpc_eth_drv_resume(struct platform_device *pdev) pldat = netdev_priv(ndev); /* Enable interface clock */ - clk_enable(pldat->clk); + ret = clk_enable(pldat->clk); + if (ret) + return ret; /* Reset and initialize */ __lpc_eth_reset(pldat); -- 2.34.1