From patchwork Mon Aug 24 08:30:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 264970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31266C433E1 for ; Mon, 24 Aug 2020 09:53:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02D912071E for ; Mon, 24 Aug 2020 09:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598262824; bh=aiRh9XyYF6dfGQtKNR2Jle8UKz4fP5jc8wiQswXz8yk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mqKF/IR+CR+MnklKTixL+lfzWZUKnJXdLIYHlcL+bWVehiIOl5SkBwVhyEmW+nz2v /59c5mBw1omj5++Wco+GeRahHBPSCY+is2Biep29xAA97qfU3hOMcOeL8+Fv4koDYC L9a0wnfSBcKCz+/ZXd6U9TDk0fRlJz1mdHT/OcqM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728822AbgHXJxj (ORCPT ); Mon, 24 Aug 2020 05:53:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:51760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728046AbgHXIhy (ORCPT ); Mon, 24 Aug 2020 04:37:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5423322B43; Mon, 24 Aug 2020 08:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598258273; bh=aiRh9XyYF6dfGQtKNR2Jle8UKz4fP5jc8wiQswXz8yk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L8foEBWZvwkAfb2u5bGfLRmjL4OJ+bBzr0Kmfd+UF/uuNNf+guKH7QMWV0pCSQGXG m7tnc7v4hEQHL1InZo2SCxB7lzp54rYEmfrX6SkssomZxVXXNqbYEwTsPgVdnGwGj/ PfHTi2tEK8MNsMuBotEvViMZ5s1tHaNMTUyUSB1s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 5.8 138/148] net: dsa: b53: check for timeout Date: Mon, 24 Aug 2020 10:30:36 +0200 Message-Id: <20200824082420.627962740@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200824082413.900489417@linuxfoundation.org> References: <20200824082413.900489417@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tom Rix [ Upstream commit 774d977abfd024e6f73484544b9abe5a5cd62de7 ] clang static analysis reports this problem b53_common.c:1583:13: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage ent.port &= ~BIT(port); ~~~~~~~~ ^ ent is set by a successful call to b53_arl_read(). Unsuccessful calls are caught by an switch statement handling specific returns. b32_arl_read() calls b53_arl_op_wait() which fails with the unhandled -ETIMEDOUT. So add -ETIMEDOUT to the switch statement. Because b53_arl_op_wait() already prints out a message, do not add another one. Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations") Signed-off-by: Tom Rix Acked-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/b53/b53_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 1df05841ab6b1..86869337223a8 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1555,6 +1555,8 @@ static int b53_arl_op(struct b53_device *dev, int op, int port, return ret; switch (ret) { + case -ETIMEDOUT: + return ret; case -ENOSPC: dev_dbg(dev->dev, "{%pM,%.4d} no space left in ARL\n", addr, vid);