Skip to content

Commit 78f058a

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Always set output parameters in bnxt_get_max_rings().
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: 6e6c5a5 ("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>
1 parent 07f4fde commit 78f058a

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+2
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8502,11 +8502,11 @@ int bnxt_get_max_rings(struct bnxt *bp, int *max_rx, int *max_tx, bool shared)
85028502
int rx, tx, cp;
85038503

85048504
_bnxt_get_max_rings(bp, &rx, &tx, &cp);
8505+
*max_rx = rx;
8506+
*max_tx = tx;
85058507
if (!rx || !tx || !cp)
85068508
return -ENOMEM;
85078509

8508-
*max_rx = rx;
8509-
*max_tx = tx;
85108510
return bnxt_trim_rings(bp, max_rx, max_tx, cp, shared);
85118511
}
85128512

0 commit comments

Comments
 (0)