net/bnxt: fix xstats get
authorSomnath Kotur <somnath.kotur@broadcom.com>
Fri, 12 Mar 2021 05:21:08 +0000 (10:51 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 12 Mar 2021 15:24:53 +0000 (16:24 +0100)
commiteac4fc71cdaa6b68dbd0e4129e5751c712501693
treef1d259aa1cf6de25e549b2a0aecca2cac1712d7e
parent527b10089cc5c65148eaa48caf9862f48c52960e
net/bnxt: fix xstats get

Fix to return count in xstats get op in all cases.
Driver was returning 0 if the 'xstats' parameter being passed to
xstats_get_op was NULL. This won't work on some applications that
rely on a valid count being passed even in this case so that it can
allocate memory accordingly followed by a reissue of the xstats_get_op
to get the actual stats populated by the driver.

Fixes: 063e59ddd28e ("net/bnxt: fix crash in xstats get")
Cc: stable@dpdk.org
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_stats.c