Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp880285rdb; Fri, 20 Oct 2023 02:01:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQJUX6zjUJjvEV5eFtjlii06tzLxUnWd1TUoPRY2GwU0XJG/TTlY4sMYZPeNqzqwAsVySt X-Received: by 2002:a05:6e02:2146:b0:34f:bed6:60d4 with SMTP id d6-20020a056e02214600b0034fbed660d4mr1717008ilv.10.1697792497935; Fri, 20 Oct 2023 02:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697792497; cv=none; d=google.com; s=arc-20160816; b=P6/XMDqLNH1q/wg6sw64JNGEpLCeOckzvn/rI6biYubPVBA1TaKm2nc1PeUmS00REF pc0RWc9YjRs/Op4KqPSXZvh+wEi/c0azeImqq0jtOCZeiRfqjJ6P8L2KTQ9tMvyu9Wjr c9Cvyp+FoA+VNo3vsQ9E5nue2mOiD+tDcj0MRGIyDZy6zJruzx4kDz2VkyZP/eh0nda5 a0VMnjmyYJK+XB1S7m1V+j69I2IVPVSgLdyH+r7Ya72ySOjqIYfzotNKya0OQRDlNYvg JQow45AsfJXKQTiRA1YJZOKc7mbGbXuwyK4VUdvWM4GxiFZg+sZGn7H6F/nvCjAWmZMR 6I9A== 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 :message-id:date:subject:cc:to:from; bh=4MnZSJRvOtNFJONxWLBfNs82xr+kQlUuqxZiFvk5wLM=; fh=41e6j7EYYiUhXc2RYrxCCawQL7Sldu38M4i4CHOT+NE=; b=1LS8rmpkAmVHOn/qFASmDFg6lzr4b8P9F6Sxu5D2BgHKattj4fnxCqv5/TAcB/pTXu MBkUFBj6qWvyO6bDjcgDxRixVyjcu5VWNiAu/Gq12USCLhwvgO0tuMqAjc6sVvAGtLLB z9u+2ro6UrEhYTBg92UaZmjLdlNFHeADLFHMwk3d+8i2/uDHXRvwX2TB4BbOVtCLKNwe 27Se5yh6KbsE1hAJ2EtceMUGBZaouqtUhgtMkk74LfRpqYVeyq8s9KLypX3BTGWj4zEU b4JHv4HOm/fuuczY8CpVfuOX5mrw/4f2ow1WBCErR5Sb1AAmutekKORs6FOUV4BFNI50 2CDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k11-20020a637b4b000000b0054fd947f66dsi1475989pgn.210.2023.10.20.02.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:01:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 774808093D6C; Fri, 20 Oct 2023 02:00:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376559AbjJTJAh (ORCPT + 99 others); Fri, 20 Oct 2023 05:00:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376521AbjJTJAd (ORCPT ); Fri, 20 Oct 2023 05:00:33 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 04C4EAB; Fri, 20 Oct 2023 02:00:29 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 5758960494CD8; Fri, 20 Oct 2023 17:00:17 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com Cc: Su Hui , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work Date: Fri, 20 Oct 2023 17:00:04 +0800 Message-Id: <20231020090003.200092-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 20 Oct 2023 02:00:42 -0700 (PDT) mv88e6xxx_tai_write() can return error code (-EOPNOTSUPP ...) if failed. So check the value of 'ret' after calling mv88e6xxx_tai_write(). Signed-off-by: Su Hui --- drivers/net/dsa/mv88e6xxx/ptp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c index ea17231dc34e..56391e09b325 100644 --- a/drivers/net/dsa/mv88e6xxx/ptp.c +++ b/drivers/net/dsa/mv88e6xxx/ptp.c @@ -182,6 +182,10 @@ static void mv88e6352_tai_event_work(struct work_struct *ugly) mv88e6xxx_reg_lock(chip); err = mv88e6xxx_tai_write(chip, MV88E6XXX_TAI_EVENT_STATUS, status[0]); mv88e6xxx_reg_unlock(chip); + if (err) { + dev_err(chip->dev, "failed to write TAI status register\n"); + return; + } /* This is an external timestamp */ ev.type = PTP_CLOCK_EXTTS; -- 2.30.2