Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp974336pxp; Wed, 16 Mar 2022 23:09:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwlQaWT7lJIJ9K3/67pijwtCBXOpDwZhMCwQVzk55b9UW5pyulhbHcpFscnlHnr5PPX6hW X-Received: by 2002:a63:202:0:b0:37c:4cfc:b89f with SMTP id 2-20020a630202000000b0037c4cfcb89fmr2437043pgc.396.1647497345956; Wed, 16 Mar 2022 23:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497345; cv=none; d=google.com; s=arc-20160816; b=vpNt+UN6TK9pP+LgO1K0Bc+vkyIic9FPb1G6WvfkL0ZosOPJyTjpSb6VyIKl0WwTEp 9lK1I2FXWkCzn3KC5fcUqW0BJ4h+pGa8ucI4c1e36Zf0lOJ+cswbkuniV3PGHVg8KvSQ 2arS8o0bzIC2viISUMVWfWOXPBaikOa6OOhHqI7FnumJD7peGfwzrVwmb3v7leFmILMd QbAnB97ybQFd8TkHWuSWJqDQwrpgcLVxfIz5pu8b0r0p7x0KOHTqpn4u21cseAPltahm 9T7ODHTh44MyVMMhlMuAWsjkfDz/QtU2JYt9yEWiRRam2J6xtiZrdjwe8NpJ3ZBTFSZE Sc7g== 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=pqlJIyb/MHE0trg95DUOT6PUgckQdDpc3deV1gE082s=; b=c0Dv0qQS+m0Wx8+U3eMw41R/AHZn4aVYQbiMXxdd2g/Gi5zV0q8xXq4fRVaEdgXUyX fB0HT1cndnkgGXom8Rgilgn7+rayUd+bGPtjOFP2MyPZxEoSyAVpzHJtmmsVjsLcDfdZ bGXz0V92V4ogi+o9uPs3URAos3EkJDgX0UR18MLXw3hsKrQb1HRYiDAszwHKQOSJENzr 8XM/ptkYTzkPqmlYxEDZ2FM+1JuvhTniIA0eJI1QLGyy7fsp/k7oQKYO/BZBGloswLjq iTYCbjqroGKCtL61Eaiy4mrzOPcR9VHfSec/kqGkiPPnwIu5ceIhfVC9jxu9/NDCLlln PJ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yvPmbewr; 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 v6-20020a17090a00c600b001bef41cdf55si6776462pjd.47.2022.03.16.23.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:09:05 -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=yvPmbewr; 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 E35EE2AB8AB; Wed, 16 Mar 2022 22:19:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241312AbiCNMR5 (ORCPT + 99 others); Mon, 14 Mar 2022 08:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242569AbiCNMKO (ORCPT ); Mon, 14 Mar 2022 08:10:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36E8027145; Mon, 14 Mar 2022 05:09:05 -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 0119161314; Mon, 14 Mar 2022 12:08:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D009C340E9; Mon, 14 Mar 2022 12:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259738; bh=qg4Tamhr5MaCuWqdiN/NuTky4KqcE9z6OeSBMmRh3WE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yvPmbewrQ8t0Yo7uxXBkdoqdEtfhfwXkZoEhidMlHpzI7J5uo4JcXidEFmTxqEbw9 4EkPDSaDFUZM9vQqOVP/IDk8JCiEfXm1oPLn4+Uko0P1wopAsAwoaZJQ9V8/7NppVG N5uOENPfSB7J/LIdiU905YjkYbcfc1XBT2ZL096k= 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.15 037/110] net: ethernet: lpc_eth: Handle error for clk_enable Date: Mon, 14 Mar 2022 12:53:39 +0100 Message-Id: <20220314112744.074078873@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112743.029192918@linuxfoundation.org> References: <20220314112743.029192918@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=-3.5 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=unavailable 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 c910fa2f40a4..919140522885 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1469,6 +1469,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); @@ -1478,7 +1479,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