]> git.baikalelectronics.ru Git - kernel.git/commit
octeontx2-af: Fix uninitialized variable in debugfs
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 21 Nov 2019 09:21:46 +0000 (12:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Nov 2019 19:42:19 +0000 (11:42 -0800)
commitd575fdb9cef41701187284a7ad08149b8ce93dae
tree650ff162585032e222ff9fa91a7e05d10d87eda1
parentf9f21642b67c26a86d30ac23b20ed8bdfade2057
octeontx2-af: Fix uninitialized variable in debugfs

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: 76bc816d6503 ("octeontx2-af: Add per CGX port level NIX Rx/Tx counters")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c