Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3440083pxp; Mon, 14 Mar 2022 20:25:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxPrswpLg0zZjmA6Lv546FIp6rSJmuBl+umqUVR/g/kovRODdaALf5xxmfBixa84mOJPzr X-Received: by 2002:a05:6a00:a8b:b0:4e1:52db:9e5c with SMTP id b11-20020a056a000a8b00b004e152db9e5cmr26363898pfl.38.1647314700376; Mon, 14 Mar 2022 20:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647314700; cv=none; d=google.com; s=arc-20160816; b=vZNzbLuyg50B8BsfAkQ8HwlkYcsXOUugvMP33aBg5ZQFg+a5LTr5RCnyJF6XFCS/Ps Odok39ilKqJGSdeLAGzjG2qLCtLhkGkbqk7G3Vv6R+rnU1kQL2mcPMXILawP2ApENQiy ll9C++JxFCficYL2Pz98/ADImXiKYQOeJDgH08gnaaYb+Pk/E06VgTRonHwffKw69OVr qSVByHWMhDakOudmTcOBsvlyVtRvq94a1w+t0Th0pOBDKPCpUP377aHJcU5DhSgi/Lx6 jbq45VkQgWHiOs05VZ2ESe31Lmf6Kb5Q2QbkE9jcPe6ShDceWMVoNyFFHzvmO118M2Ve cZsg== 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=DyycJjpueXO7gWrajRKzs+FbPZPxRYuOuGohsv10ypA=; b=rOEoqxUq5ylbM/tEmYAaED68vPAZEXaoE26FnSl5imc+Lo7493I6/c6WN0zbSXg3/4 r1UWS9XjNkkBquocOjc+zrh+zrDEjKiI58y+GwQbjXaIUJ0OC/AnCWJ7bhWtjGxmUpOH q3Ubrv1MfU1i0NSj/P9j+sXR85oQjABZ84pSuvgCwZcsxB07vCmJ2uuDk+CNDR1U0ybM znMpGQRLlff1AUn77i12TCQ0VHIAyQbashoDULPS9kDJyetI7IhZjTKTWRuBVEhIt35r 1trhS7a66MYo0WRKdHnKfERXXZipqY2b/SiI7GYgApdjRt49tIc1gUqlbqRTEP4uOsoO gElw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mYdWbMfR; 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 j2-20020a17090ae60200b001bf700775e6si765580pjy.73.2022.03.14.20.24.46; Mon, 14 Mar 2022 20:25:00 -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=mYdWbMfR; 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 S238544AbiCNMZp (ORCPT + 99 others); Mon, 14 Mar 2022 08:25:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242521AbiCNMTH (ORCPT ); Mon, 14 Mar 2022 08:19:07 -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 075804F460; Mon, 14 Mar 2022 05:14:17 -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 D4321B80DBF; Mon, 14 Mar 2022 12:14:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CB52C340EC; Mon, 14 Mar 2022 12:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260054; bh=sFF5kOSFIYhuLY8fRw2uLPZeHATbtnDGZk9fWhUpgkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mYdWbMfR6t75m9eXoAGAbMWzO78jR5g/1IDIlX8Fi1pTVw0eDCUTDGLK/sgV0XxqK IVgGd81MNau1DqFDPE9Z0YKiwnQUQYzMeYHQr4JdGtyjHYL9MSA4M9C3B4W6LnzuFB +90YgCHhAlWGhMRw1sXD49HP4/xPzitbxBra386k= 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 5.16 042/121] net: ethernet: lpc_eth: Handle error for clk_enable Date: Mon, 14 Mar 2022 12:53:45 +0100 Message-Id: <20220314112745.302151330@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112744.120491875@linuxfoundation.org> References: <20220314112744.120491875@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 bc39558fe82b..756f97dce85b 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1471,6 +1471,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); @@ -1480,7 +1481,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