From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 52FD8C432C0 for ; Thu, 21 Nov 2019 19:42:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D9BF2063A for ; Thu, 21 Nov 2019 19:42:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbfKUTmd (ORCPT ); Thu, 21 Nov 2019 14:42:33 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:52328 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbfKUTmd (ORCPT ); Thu, 21 Nov 2019 14:42:33 -0500 Received: from localhost (unknown [IPv6:2001:558:600a:cc:f9f3:9371:b0b8:cb13]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 6F6AD1503D3D2; Thu, 21 Nov 2019 11:42:32 -0800 (PST) Date: Thu, 21 Nov 2019 11:42:31 -0800 (PST) Message-Id: <20191121.114231.144140953957043920.davem@davemloft.net> To: dan.carpenter@oracle.com Cc: sgoutham@marvell.com, lcherian@marvell.com, gakula@marvell.com, jerinj@marvell.com, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH net-next] octeontx2-af: Fix uninitialized variable in debugfs From: David Miller In-Reply-To: <20191121092146.hnvdwnzpirskw3wr@kili.mountain> References: <20191121092146.hnvdwnzpirskw3wr@kili.mountain> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 21 Nov 2019 11:42:32 -0800 (PST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Dan Carpenter Date: Thu, 21 Nov 2019 12:21:46 +0300 > If rvu_get_blkaddr() fails, then this rvu_cgx_nix_cuml_stats() returns > zero and we write some uninitialized data into the debugfs output. > > On the error paths, the use of the uninitialized "*stat" is harmless, > but it will lead to a Smatch warning (static analysis) and a UBSan > warning (runtime analysis) so we should prevent that as well. > > Fixes: f967488d095e ("octeontx2-af: Add per CGX port level NIX Rx/Tx counters") > Signed-off-by: Dan Carpenter Applied.