History

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.

Alok Tiwari committed 3 months ago

Commit 2cbd8a41 parent 6310aaa1 file · +2 −1Browse files

Unified · Split

drivers/net/ethernet/broadcom/bnge/bnge_resc.c+2−1
@@ -163,7 +163,8 @@ static int bnge_adjust_rings(struct bnge_dev *bd, u16 *rx, · 162 unmodified lines
163 u16 tx_chunks = bnge_num_tx_to_cp(bd, *tx);163 u16 tx_chunks = bnge_num_tx_to_cp(bd, *tx);
164 164
165 if (tx_chunks != *tx) {165 if (tx_chunks != *tx) {
166 u16 tx_saved = tx_chunks, rc;166 u16 tx_saved = tx_chunks;
167 int rc;
167 168
168 rc = bnge_fix_rings_count(rx, &tx_chunks, max_nq, sh);169 rc = bnge_fix_rings_count(rx, &tx_chunks, max_nq, sh);
169 if (rc)170 if (rc)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t