]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bnxt_en: Always set output parameters in bnxt_get_max_rings().
authorMichael Chan <michael.chan@broadcom.com>
Mon, 9 Jul 2018 06:24:49 +0000 (02:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:07:05 +0000 (13:07 +0200)
commite678c47251bedef1cf9bbcb967e02305e6780b87
treea26277e98b1ec7424f1003a7faa29c04be8802c2
parent5ef273fbb3eca2f7767abd43b93c3c393dd79c74
bnxt_en: Always set output parameters in bnxt_get_max_rings().

[ Upstream commit 78f058a4aa0f2280dc4d45d2c4a95728398ef857 ]

The current code returns -ENOMEM and does not bother to set the output
parameters to 0 when no rings are available.  Some callers, such as
bnxt_get_channels() will display garbage ring numbers when that happens.
Fix it by always setting the output parameters.

Fixes: 6e6c5a57fbe1 ("bnxt_en: Modify bnxt_get_max_rings() to support shared or non shared rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c