From patchwork Wed Jul 10 13:06:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 168803 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp9943275ilk; Wed, 10 Jul 2019 06:06:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRSE3PVczIfV8rd6bqtOyNt115/niuO+u1mrLFbGvUKzt8HDIXxMvc5q+KneDlW8j0ej0C X-Received: by 2002:a17:902:2bcb:: with SMTP id l69mr38960683plb.155.1562764010344; Wed, 10 Jul 2019 06:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562764010; cv=none; d=google.com; s=arc-20160816; b=xoLXqGAGTzAxpcmLib7ZLZm58GNv9HScoEsbyUbk/Qc2mSjLBXJLjl39/zmaySxyn8 /4PMzhdtR2OmnvkoCaU6Gk9FNwZxdSi6/fFStPsGmldOiSwl+iLLpDkMYnp8y7nPe0h+ 8vGDwjiWypo19UAvEJ7xxzCaGgCnaRZcgbVNmiuEPbIFloNqLEUwBtz46p9O/6DMEn31 soCIx7rpdgrwy75VdmJ9K7fc4mB6t06hOfAhAaQmcA7Fl+RBD353Q5A5xd4kJ7vgcaTO C0nmIylBFKiZlMU5DaxQLMU4tDkiNRx6Vrzq8b/g8KoaTxF2EMlvi7Zb/QgN7feOAKRW bCRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=FSBbmvFsrXE5ztUNpO2m+oSWTy7R/T7VVQJtHHIPXpg=; b=BUv2kUANRV74ia5V93ciVds4fC7mdGR14+8v6UpcZ/3LS66hRXWliSQgjiQx72aw+1 YIsG3gyK7VaT5wp20zXSmVWBy12KrtSM+gfAYIJNUkTQNfuVK/nAFVmZwWCQAFuTm7TM QvhIKrX+nVjCkf5ooNt3rQbgleoUEgk1zgKj1IbSV4426ahA6commd2rVaUvZfCx4tT3 5Z+VOfsP40ww9ME5IVPHmA9c4iHaf9iT+zEz8Onj0maa+IJq0KPCnXn3Ru7vuw5CLjGY MkYN475x4hztJeW7MpwET8o/cbQ6+adawSpRrN+0zxBGugHy/7lqjjw0IMC6q0Wy2vTQ hVqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b41si2097888pla.409.2019.07.10.06.06.50; Wed, 10 Jul 2019 06:06:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbfGJNGs (ORCPT + 30 others); Wed, 10 Jul 2019 09:06:48 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:38051 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfGJNGs (ORCPT ); Wed, 10 Jul 2019 09:06:48 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1M3D7V-1hm2JW3OeL-003g8Z; Wed, 10 Jul 2019 15:06:39 +0200 From: Arnd Bergmann To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" Cc: Arnd Bergmann , Tariq Toukan , Eran Ben Elisha , Boris Pismenny , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] [net-next] net/mlx5e: avoid uninitialized variable use Date: Wed, 10 Jul 2019 15:06:25 +0200 Message-Id: <20190710130638.1846846-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:OagwmaqadWf3LLlQrhjJSVaeSjbS3TmtJcZ3CrnuAX5DMD8ITzm ktDnEOx8Fav3TkBNgGmRuBDQcd+O3uMS/DPb2l7nlkQq5APDDTOu0xhxM/FosKfuEiwQ3FX esCE9oodv/0lVTx8ELKsL5sepuUzlb3hNy3apL9fStL50eDfVCFs7TawPDuvRFZoDD0Hizj i8NqlXEBkMxuxPLUImkdw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:oIx5To/fs4o=:lfiVVCDpGws6UHS6mAlZTB jEFGRZpVp2MJvuVB+0yviZaF37r7+EmQuWVHNU1N1L7/TEKw5kfsCgDL/f8LSoii/cFfdVDaA 7ASsNalRexdaRr8JTNNPlJ4ZbpZaP8vjlzUIeQZfGUbL8g7OOKPhHEUi+PNNWYkQkHwcn9eet 56ONXWrSxn4J6vQJhzPysXJHBg5Ek0Ez6EFpL418qaKMF8ML0qbOQa6Vqt1AyHeFzfjnrjyE1 xH5Ry0K2d5F95OWo3Xotiq+CTS59LoNXRM/NH8BsU5DIRXcaILh4epHgKBd+DcI3a69V1NuSC RIPyB3YAOVnfijM8JWyjGoMUXtNs7FDImBLCT7dg+nOWLtjd8n6noZUCWSgwmDbsEmIDIM+Jd vJbEhl4WdIVsENmwCl/Nv+/yxooqpizffGwd6P1vB5jC5ru04Ejz4YAQWPFdi/8bjKkasWRPK +oUFIYM78QYVgZqey5MguGbG6C4m6dyxZdv0lVWoQLCjznBCpXPuc1aNTa8pRhkSTtjHcAaf/ wa5vFC3AAS21irUkxEPtwpxztJxU8w34SNIRDaTBzMFA0Rg3VAb4Y6ongwXEyof8075tmG794 PqRQVYh2sBew32Z+Z85umbqN42uM9QmEv6idXzARiXxM75EnxTyeczOhKOq3gGvhAO0nKxwNn lYyeaXbGC6rUms044EuYhd2QcppJqJ2Pc4jAbg/E1aWhijn+dbShVYLmo1mXA9D/WMcv3cYYl il78i9PP1ey995GCxW3PltDZ64R40fUG1g1VMA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clang points to a variable being used in an unexpected code path: drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c:251:2: warning: variable 'rec_seq_sz' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c:255:46: note: uninitialized use occurs here skip_static_post = !memcmp(rec_seq, &rn_be, rec_seq_sz); ^~~~~~~~~~ >From looking at the function logic, it seems that there is no sensible way to continue here, so just return early and hope for the best. Fixes: d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.0 Reviewed-by: Tariq Toukan diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c index 3f5f4317a22b..5c08891806f0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c @@ -250,6 +250,7 @@ tx_post_resync_params(struct mlx5e_txqsq *sq, } default: WARN_ON(1); + return; } skip_static_post = !memcmp(rec_seq, &rn_be, rec_seq_sz);