All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: chelsio: Add a missing check on cudg_get_buffer
@ 2018-12-24 21:21 Aditya Pakki
  2018-12-28  0:19 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2018-12-24 21:21 UTC (permalink / raw)
  To: pakki001; +Cc: kjlu, Arjun Vynipadath, David S. Miller, netdev, linux-kernel

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>
---
 drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
index 7c49681407ad..127b1f624413 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
@@ -1229,6 +1229,10 @@ int cudbg_collect_hw_sched(struct cudbg_init *pdbg_init,
 
 	rc = cudbg_get_buff(pdbg_init, dbg_buff, sizeof(struct cudbg_hw_sched),
 			    &temp_buff);
+
+	if (rc)
+		return rc;
+
 	hw_sched_buff = (struct cudbg_hw_sched *)temp_buff.data;
 	hw_sched_buff->map = t4_read_reg(padap, TP_TX_MOD_QUEUE_REQ_MAP_A);
 	hw_sched_buff->mode = TIMERMODE_G(t4_read_reg(padap, TP_MOD_CONFIG_A));
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: chelsio: Add a missing check on cudg_get_buffer
  2018-12-24 21:21 [PATCH] net: chelsio: Add a missing check on cudg_get_buffer Aditya Pakki
@ 2018-12-28  0:19 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-28  0:19 UTC (permalink / raw)
  To: pakki001; +Cc: kjlu, arjun, netdev, linux-kernel

From: Aditya Pakki <pakki001@umn.edu>
Date: Mon, 24 Dec 2018 15:21:21 -0600

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-28  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-24 21:21 [PATCH] net: chelsio: Add a missing check on cudg_get_buffer Aditya Pakki
2018-12-28  0:19 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.