Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3184876pxp; Mon, 14 Mar 2022 12:48:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2Kq7d4t/Kdl8peaCjdMcqmjqwocyhHwU0GSDKsgsHB1q4VoIq0ZWNXrEzTDNS/RnMa6OV X-Received: by 2002:a17:906:fad5:b0:6ce:e056:5918 with SMTP id lu21-20020a170906fad500b006cee0565918mr19849024ejb.562.1647287283558; Mon, 14 Mar 2022 12:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647287283; cv=none; d=google.com; s=arc-20160816; b=Y0siau2nZBd9vPBZNazubJ79B532o62Du5Dbn1Kso+0VQKj3hZNBp+B/HofoXfNzB0 1Z0Zf/CG13h2x9G5D57/vb6lWSTtBgoj9TNdaMmbRcNIAb+voiTW/BKVl1+9d77DTITJ 1kDtLwVuiZ9ruH6VnIjmDE/eZAod4DqKJO1zzdPECIDDlbm6e5ficJSL5Q2WDVMfbD68 IDwIvmRrU0KZFqRwhJZLsVBfrPD4NvvkPgVpxmi84zbInE4aZ86JG75/GeSDf9I1sXpD urNfs8LGwhxM5lP22V4Ah+wmCRqUjV5WFW7Y+gXG3DvJpN1AwYQftkEoI7Ma2uruBF/d ov5g== 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=6F6iGfLesWmLLSL9OzGhLLM5VqYC6eqRC5tVtYQ4QIA=; b=h3W4DIVx0jyvlZr74kh2DhahbLBKhNq/JJdlPnfPZxCbH40vuJ/lUFAUSEPua0UUkY MZOTNi27603l33RdTyyM/Vuffkwbmgp9m6le43uWBXtRTDWDcnG0+32NxjyEoqrh5gm9 nH5oAsgnDB83NcZi3kx5GoBqpZ1RIiNrxffyMbFS/s7d5rKrAg/+1LavLUJPvr5OiAg+ mg6oifjrarXl1AJEkQuFULWWTuLkg/NDta4dy79/XM/cBI3f+8KRgOw1WGAa0lZoxCwI S5FxGNxLh6OARDQSGBiizmLATB452W+2Bs5YOthe5icQL7s5G1zz2Nkyqb9+OSlWdkj2 LybQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="z/IhsISb"; 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 y17-20020a056402441100b00412f4a296aesi14071573eda.174.2022.03.14.12.47.38; Mon, 14 Mar 2022 12:48:03 -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="z/IhsISb"; 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 S241118AbiCNM0G (ORCPT + 99 others); Mon, 14 Mar 2022 08:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242428AbiCNMTA (ORCPT ); Mon, 14 Mar 2022 08:19:00 -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 5B7C24E3AA; Mon, 14 Mar 2022 05:14:12 -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 D8EF960B09; Mon, 14 Mar 2022 12:14:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E27D3C340E9; Mon, 14 Mar 2022 12:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260051; bh=ZLHV/ijyzxqyLndfEsqIgFthJJDTK+xbOtWlHN6N4qk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z/IhsISbBUSkiUbxg8Q06iVjB1djpB43tYECrvqSHUa9+UjTdZgDoT3FPgcFn30Dk 7orQnyPQQFx0bZfqWyX3GG4XlAamhjwvDpt44ogJ+Xor+6msTe1gZpqw4pv5L4qPg2 8h+n2kMmD0a9c5wYPXj4vmE3zpLQy0cK7qm5R0Eo= 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 041/121] net: ethernet: ti: cpts: Handle error for clk_enable Date: Mon, 14 Mar 2022 12:53:44 +0100 Message-Id: <20220314112745.274647273@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 6babfc6e6fab068018c36e8f6605184b8c0b349d ] As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: 8a2c9a5ab4b9 ("net: ethernet: ti: cpts: rework initialization/deinitialization") Signed-off-by: Jiasheng Jiang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/cpts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index dc70a6bfaa6a..92ca739fac01 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -568,7 +568,9 @@ int cpts_register(struct cpts *cpts) for (i = 0; i < CPTS_MAX_EVENTS; i++) list_add(&cpts->pool_data[i].list, &cpts->pool); - clk_enable(cpts->refclk); + err = clk_enable(cpts->refclk); + if (err) + return err; cpts_write32(cpts, CPTS_EN, control); cpts_write32(cpts, TS_PEND_EN, int_enable); -- 2.34.1