mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 21:35:13 -04:00
bnge: use int for bnge_fix_rings_count() return value
bnge_fix_rings_count() returns 0 on success or a negative errno on failure
However, bnge_adjust_rings() stores its return value in a u16 variable,
causing negative error codes such as -ENOMEM to be converted to a large
positive value.
Use an int for the return code variable so that error values are
preserved and propagated correctly.
Fixes: 627c67f038 ("bng_en: Add resource management support")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Bhargava Marreddy <bhargava.marreddy@broadcom.com>
Link: https://patch.msgid.link/20260801100923.1498570-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
6310aaadbf
commit
2cbd8a4e5e
@@ -163,7 +163,8 @@ static int bnge_adjust_rings(struct bnge_dev *bd, u16 *rx,
|
||||
u16 tx_chunks = bnge_num_tx_to_cp(bd, *tx);
|
||||
|
||||
if (tx_chunks != *tx) {
|
||||
u16 tx_saved = tx_chunks, rc;
|
||||
u16 tx_saved = tx_chunks;
|
||||
int rc;
|
||||
|
||||
rc = bnge_fix_rings_count(rx, &tx_chunks, max_nq, sh);
|
||||
if (rc)
|
||||
|
||||
Reference in New Issue
Block a user