diff options
author | Bogdan Hamciuc <bogdan.hamciuc@freescale.com> | 2013-06-07 12:06:49 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-06-11 16:55:51 (GMT) |
commit | b676b243d7ccdd4879ea8c5fb74a6d3e2a7f2e5e (patch) | |
tree | d7bdae9dccccf9a98ecad1c614489ecd72cc14da /drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | |
parent | 7e953df95c4f5491173e395d26d1bdc143918559 (diff) | |
download | linux-fsl-qoriq-b676b243d7ccdd4879ea8c5fb74a6d3e2a7f2e5e.tar.xz |
dpaa_eth: Fix endless loop in case of memory depletion
Check the return value from the buffer-allocating function, in order to
prevent looping forever if memory depletes.
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Change-Id: Ia321b33ebb38012679248ae4905d4dafaa8efd7d
Reviewed-on: http://git.am.freescale.net:8181/2928
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Radulescu Ruxandra Ioana-B05472 <ruxandra.radulescu@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index 0f0f726..a47dfab 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -128,7 +128,9 @@ release_bufs: return i; bail_out: - dev_err(dpa_bp->dev, "dpa_bp_add_8_pages() failed\n"); + net_err_ratelimited("dpa_bp_add_8_pages() failed\n"); + WARN_ONCE(1, "Memory allocation failure on Rx\n"); + bm_buffer_set64(&bmb[i], 0); /* * Avoid releasing a completely null buffer; bman_release() requires |