Skip to content

Commit ca19fcb

Browse files
Aditya Pakkidavem330
authored andcommitted
net: chelsio: Add a missing check on cudg_get_buffer
cudbg_collect_hw_sched() could fail when the function cudg_get_buffer() returns an error. The fix adds a check to the latter function returning error on failure Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f0fb9b2 commit ca19fcb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,10 @@ int cudbg_collect_hw_sched(struct cudbg_init *pdbg_init,
12291229

12301230
rc = cudbg_get_buff(pdbg_init, dbg_buff, sizeof(struct cudbg_hw_sched),
12311231
&temp_buff);
1232+
1233+
if (rc)
1234+
return rc;
1235+
12321236
hw_sched_buff = (struct cudbg_hw_sched *)temp_buff.data;
12331237
hw_sched_buff->map = t4_read_reg(padap, TP_TX_MOD_QUEUE_REQ_MAP_A);
12341238
hw_sched_buff->mode = TIMERMODE_G(t4_read_reg(padap, TP_MOD_CONFIG_A));

0 commit comments

Comments
 (0)